public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: loody <miloody@gmail.com>
To: binutils@sourceware.org, amodra@gmail.com
Subject: Re: some question about output section
Date: Wed, 04 May 2011 15:51:00 -0000	[thread overview]
Message-ID: <BANLkTikKDOvz1ro3tWkEGxO=DXk-dj3eLg@mail.gmail.com> (raw)
In-Reply-To: <BANLkTin7UtPRsk4s=J1TXyARzgEhOODL5w@mail.gmail.com>

hi all:

2011/5/1 loody <miloody@gmail.com>:
> hi:
> Thanks for your kind hint :-)
>
> 2011/4/29 Alan Modra <amodra@gmail.com>:
>> 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
‘archive:file’
 matches file within archive
‘archive:’
 matches the whole archive

And I make 2 links script to link all the *.o files below link_folder
1.
OUTPUT_ARCH(mips)
SECTIONS
{
  .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
TEST_LINK.map --oformat elf32-tradlittlemips
 mipsel-linux-gnu-ld: no input files


2,
OUTPUT_ARCH(mips)
 SECTIONS
 {
  .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,
miloody

  reply	other threads:[~2011-05-04 15:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-27 15:29 loody
2011-04-28  0:57 ` Alan Modra
2011-04-28 16:17   ` loody
2011-04-29  0:32     ` Alan Modra
2011-05-01 13:21       ` loody
2011-05-04 15:51         ` loody [this message]
2011-05-05  0:35           ` Alan Modra
2011-05-05  3:00             ` loody
2011-05-05  3:57               ` Alan Modra
2011-05-11  6:27                 ` loody
2011-05-11  7:18                   ` Alan Modra
2011-05-11  8:12                     ` loody
2011-05-18  5:32                     ` loody
2011-05-19  4:31                       ` loody

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='BANLkTikKDOvz1ro3tWkEGxO=DXk-dj3eLg@mail.gmail.com' \
    --to=miloody@gmail.com \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).