This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: KEEP sections without writing a complete linker script?


* Tristan Gingold <gingold@adacore.com> [10-06-17 18:12]:
> >>> | /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.

This won't work either, as -dT also expects a file name as parameter.

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.

Sorry for the noise,
    Lars Noschinski


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]