This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
KEEP sections without writing a complete linker script?
- From: Lars Noschinski <lars at public dot noschinski dot de>
- To: binutils at sourceware dot org
- Date: Thu, 17 Jun 2010 15:15:11 +0200
- Subject: 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