This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: KEEP sections without writing a complete linker script?
On 18/06/2010 08:56, Tristan Gingold wrote:
> On Jun 17, 2010, at 7:54 PM, Lars Noschinski wrote:
>> But after re-reading the documentation, if found that the INSERT command
>> does exactly what I want:
>>
>> Using the script
>>
>> | SECTIONS
>> | {
>> | .bootcall_trampoline :
>> | {
>> | KEEP(*(.bootcall_trampoline))
>> | }
>> | }
>> | INSERT AFTER .text
>>
>> I may call the linker with "-T myscript.ld" and everything works as
>> expected.
>
> Right, this seems indeed to be the best method.
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?
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