This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Archive members in input section descriptions?
- From: Nick Clifton <nickc at redhat dot com>
- To: Reto Hermann <rhe at zurich dot ibm dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 26 Sep 2007 18:05:16 +0100
- Subject: Re: Archive members in input section descriptions?
- References: <000101c7d02c$5a675b90$0100a8c0@zurich.ibm.com>
Hi Reto,
I have a library archive libfoo.a containing members bar1.o and bar2.o. This
library is provided to me, i.e., I do not build it myself.
I would like to link the archive members bar1.o and bar2.o such, that they
end up in different segments of the ELF executable, e.g., bar1.o in .text
(which resides in ROM) and bar2.o in .text.fast (which resides in RAM).
Is this possible?
Yes, but you have to either extract the object files from the archive first and
then refer to them directly by name in the linker scripts.
How would the input section descriptions for bar1.o and
bar2.o in .text and .text.fast look like?
Like this:
SECTIONS
{
.text { *(EXCLUDE_FILE (*bar2.o) .text) }
.text.fast { *(.text) }
}
Cheers
Nick