KEEP sections without writing a complete linker script?

Tristan Gingold
Fri Jun 18 14:42:00 GMT 2010

On Jun 18, 2010, at 4:13 PM, Dave Korn wrote:
>  You guys are making my head hurt!  How is that supposed to work, when -T
> "replaces `ld''s default linker script (rather than adding to it)"?  What is
> there to INSERT AFTER if you use -T?

See the documentation:

INSERT [ AFTER | BEFORE ] output_section
This command is typically used in a script specified by `-T' to augment the default SECTIONS with, for example, overlays. It inserts all prior linker script statements after (or before) output_section, and also causes `-T' to not override the default linker script.

>  As far as I understand you don't want to use any option at all.  Just pass
> the name of the script fragment on the command-line (regardless whether passed
> via gcc or invoking ld directly) and it gets appended to the default script.
>    cheers,
>      DaveK

More information about the Binutils mailing list