some question about output section

Alan Modra amodra@gmail.com
Thu May 5 03:57:00 GMT 2011


On Thu, May 05, 2011 at 11:00:01AM +0800, loody wrote:
>   .onlyText 0x80000000 : {  lib2.a:*.o (*.text)  }

So this tells ld where to put lib2.a object files,

> mipsel-linux-gnu-ld -Bstatic -T ./link.xn -o TEST_LINK.elf -Map
> TEST_LINK.map --oformat elf32-tradlittlemips lib2.a

and the above says to extract files from lib2.a if they satisfy
undefined references at the point where lib2.a is searched in the link
process.  That is the way archives work.  You don't have any other
object files or -u command line options, so no undefined symbol
references!  You'll need --whole-archive to have the entire contents
of the archive extracted.

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list