bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Overloading ld linker script is not working after 2_36


From: Phil Wiggum
Subject: Overloading ld linker script is not working after 2_36
Date: Tue, 14 Feb 2023 19:54:29 +0100

I can't get NOLOAD working any more.
This used to work before binutils_2_36.

Default linker script 'cc430f5137.ld' is overloaded with a script file (without 
-T)

SECTIONS
{
  .infoA  (NOLOAD)   : {} > INFOA
  .infoB  (NOLOAD)   : {} > INFOB
  .infoC  (NOLOAD)   : {} > INFOC
  .infoD  (NOLOAD)   : {} > INFOD
}

From ld man page:
If the linker cannot recognize the format of an object file, it
will assume that it is a linker script.  A script specified in
this way augments the main linker script used for the link
(either the default linker script or the one specified by using
-T).  This feature permits the linker to link against a file
which appears to be an object or an archive, but actually merely
defines some symbol values, or uses "INPUT" or "GROUP" to load
other objects.  Specifying a script in this way merely augments
the main linker script, with the extra commands placed after the
main script; use the -T option to replace the default linker
script entirely, but note the effect of the "INSERT" command.

Default cc430f5137.ld...
....
  .infoA     : {} > INFOA   /* MSP430 INFO FLASH MEMORY SEGMENTS */
  .infoB     : {} > INFOB
  .infoC     : {} > INFOC
  .infoD     : {} > INFOD
....

Modifying default script with NOLOAD works, but not if I try to overload it.


msp430-elf-gcc -Wl,--as-needed -Wl,--no-undefined -mmcu=cc430f5137 
-Wl,--start-group -Wl,--end-group -Wl,--verbose=255 overload-ld/cc430f5137.ld 
-Wl,-gc-sections -Wl,-Map,cc430f5137.map main.o -o out


//Phil

Attachment: cc430f5137.ld
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]