This is the mail archive of the binutils@sources.redhat.com 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: Matching object files in an archieve in linker script?


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


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