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 Jun 17, 2010, at 6:01 PM, Lars Noschinski wrote:
> * Tristan Gingold <gingold@adacore.com> [10-06-17 15:28]:
>>> | SECTIONS
>>> | {
>>> | .bootcall_trampoline :
>>> | {
>>> | *(.bootcall_trampoline)
>>> | KEEP(*(.bootcall_trampoline))
>>> | }
>>> | }
>>>
>>> This seems to work, but gives me the annoying warning
>>>
>>> | /usr/lib/gcc/avr/4.3.4/../../../avr/bin/ld: warning: keep_bootcall.x contains output sections; did you forget -T?
> [...]
>> How did you invoke gcc or ld ? It seems, according to the error message, that you forget the -T switch. Ie, you
>> should use something like -Wl,-T,myscript.ld
>
> Using -T would give me not the effect I wanted, as this would replace
> the default linker script.
Ok, you can use -Wl,-dT,-T,myscript.ld to also read the default linker script.
Tristan.