From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6910 invoked by alias); 4 May 2011 15:51:41 -0000 Received: (qmail 6900 invoked by uid 22791); 4 May 2011 15:51:39 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,TW_LH,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-iw0-f169.google.com (HELO mail-iw0-f169.google.com) (209.85.214.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 May 2011 15:51:25 +0000 Received: by iwg8 with SMTP id 8so1425611iwg.0 for ; Wed, 04 May 2011 08:51:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.42.161.197 with SMTP id u5mr1879043icx.466.1304524284809; Wed, 04 May 2011 08:51:24 -0700 (PDT) Received: by 10.42.167.1 with HTTP; Wed, 4 May 2011 08:51:24 -0700 (PDT) In-Reply-To: References: <20110428005642.GG19947@bubble.grove.modra.org> <20110429003231.GO19947@bubble.grove.modra.org> Date: Wed, 04 May 2011 15:51:00 -0000 Message-ID: Subject: Re: some question about output section From: loody To: binutils@sourceware.org, amodra@gmail.com Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2011-05/txt/msg00053.txt.bz2 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. =A0Also review when ld extracts elements from archives. >> Below I excerpt the content of the document =91archive:file=92 matches file within archive =91archive:=92 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