This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Matching object files in an archieve in linker script?
- From: Nick Clifton <nickc at redhat dot com>
- To: Tao Zhang <zhangtao at cc dot gatech dot edu>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 29 Jul 2004 14:44:38 +0100
- Subject: Re: Matching object files in an archieve in linker script?
- References: <Pine.GSO.4.58.0407222254270.27851@gaia.cc.gatech.edu>
Hi Tao,
I know I can match an archieve in a linker script like:
.ovly1 { /home/zhangta/tests/cgpart/libfoo1.a(.text) }
But is it possible to match the object files in an archieve?
No sorry - this is not possible with the current linker script syntax.
> What if I want to give bar1.o and bar2.o in foo1.a different virtual
addresses?
Could it be done?
If the sections within bar1.o and bar2.o have unique names, then yes
this can be done. For example if bar1.o contains sections called
.text.bar1 and .data.bar1 and bar2.o contains sections called .text.bar2
and .data.bar2 then you could use a linker script fragment like this:
.text.bar1 : 0x1000 { /home/zhangta/tests/cgpart/libfoo1.a(.text.bar1) }
.text.bar2 : 0x2000 { /home/zhangta/tests/cgpart/libfoo1.a(.text.bar2) }
.data.bar1 : 0x4000 { /home/zhangta/tests/cgpart/libfoo1.a(.data.bar1) }
.data.bar2 : 0x5000 { /home/zhangta/tests/cgpart/libfoo1.a(.data.bar1) }
Cheers
Nick