Skip to content

Commit

Permalink
cpu/msp430_common: Fix linking with binutils 2.40
Browse files Browse the repository at this point in the history
An `INSERT AFTER` directive no longer can refer to a different linker
script included with `-T path/to/script.ld`. Instead, this adds wrapper
linker scripts that just `INCLUDE` the three individual linker scripts.
This way, the xfa.ld can safely refer back to sections defined in
the vendor linker script.
  • Loading branch information
maribu committed Apr 21, 2023
1 parent 812c216 commit af2e36b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions cpu/msp430_common/ldscripts/riot-msp430f1611.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
INCLUDE msp430f1611.ld
INCLUDE msp430_common.ld
INCLUDE xfa.ld
3 changes: 3 additions & 0 deletions cpu/msp430_common/ldscripts/riot-msp430f1612.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
INCLUDE msp430f1612.ld
INCLUDE msp430_common.ld
INCLUDE xfa.ld
3 changes: 3 additions & 0 deletions cpu/msp430_common/ldscripts/riot-msp430f1617.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
INCLUDE msp430f1617.ld
INCLUDE msp430_common.ld
INCLUDE xfa.ld
8 changes: 4 additions & 4 deletions makefiles/arch/msp430.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ CFLAGS += $(CFLAGS_CPU) $(CFLAGS_LINK) $(CFLAGS_DBG) $(CFLAGS_OPT)
ASFLAGS += $(CFLAGS_CPU) --defsym $(CPU_MODEL)=1 $(CFLAGS_DBG)

LINKFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG) $(CFLAGS_OPT)
LINKFLAGS += -Wl,--gc-sections -Wl,-L$(MSP430_SUPPORT_FILES)/include
LINKFLAGS += -T $(MSP430_SUPPORT_FILES)/include/$(CPU_MODEL).ld
LINKFLAGS += -T $(RIOTCPU)/msp430_common/ldscripts/msp430_common.ld
LINKFLAGS += $(RIOTCPU)/msp430_common/ldscripts/xfa.ld
LINKFLAGS += -Wl,--gc-sections
LINKFLAGS += -Wl,-L$(MSP430_SUPPORT_FILES)/include
LINKFLAGS += -Wl,-L$(RIOTCPU)/msp430_common/ldscripts
LINKFLAGS += -T riot-$(CPU_MODEL).ld

OPTIONAL_CFLAGS_BLACKLIST += -fdiagnostics-color
OPTIONAL_CFLAGS_BLACKLIST += -Wformat-overflow
Expand Down

0 comments on commit af2e36b

Please sign in to comment.