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]

KEEP sections without writing a complete linker script?


Hi,

is there a way to explicitely KEEP a section without needing to write a
whole new linker file?

It seemed to me that using a script which is appended to the default
script is a way to go, so I wrote the following script:

| 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?

So I have got two questions:

  - Is my approach correct?
  - If yes, can this warning be suppressed?

Greetings,
    Lars Noschinski


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