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]

Re: Archive members in input section descriptions?


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


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