some question about output section

Wed May 4 15:51:00 GMT 2011

hi all:

2011/5/1 loody <>:
> hi:
> Thanks for your kind hint :-)
> 2011/4/29 Alan Modra <>:
>> On Fri, Apr 29, 2011 at 12:17:18AM +0800, loody wrote:
>>> after studying the ld info
>> Study some more.  Also review when ld extracts elements from archives.
Below I excerpt the content of the document
 matches file within archive
 matches the whole archive

And I make 2 links script to link all the *.o files below link_folder
  .onlyText 0x80000000 :{ link_folder:*.o (.text) }
ld tell me he cannot find "input files" by this script
 mipsel-linux-gnu-ld -Bstatic -T ./link.xn -o TEST_LINK.elf -Map --oformat elf32-tradlittlemips
 mipsel-linux-gnu-ld: no input files

  .onlyText 0x80000000 :  { link_folder: (.text)  }
ld can successfully generate elf file for me, but I cannot see the
output section I give in script.

Below are the contents of ./link_folder
# ls link_folder/ -lht
 total 12K
 -rw-r--r-- 1 root root 4.8K 2011-05-04 21:29 file1.o
 -rw-r--r-- 1 root root 3.7K 2011-05-04 21:29 main.o

My questions are:
1. in document, it say "Either one or both of `archive' and `file' can
contain shell wildcards." In my script1, I wrote the 'file' part to
meet all *.o files. Why ld told me he cannot find them?

2. in script2, I follow the rule " `archive:' matches the whole
archive". So ld doesn't tell me he cannot find them, But why final elf
still don't include the section I wrote in script, furthermore, the
elf doesn't any .text .data .bss secion.

3. I think "lib1.a:" is not the correct usage to tell ld to search for
the object files content in lib1.a, since lib1.a is not an archive,
right? (I thought archive here in document means real folder)

appreciate your kind help,

More information about the Binutils mailing list