From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21849 invoked by alias); 1 May 2011 13:21:16 -0000 Received: (qmail 21841 invoked by uid 22791); 1 May 2011 13:21:15 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,TW_BF,TW_LH,TW_XB,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-ww0-f43.google.com (HELO mail-ww0-f43.google.com) (74.125.82.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 01 May 2011 13:21:00 +0000 Received: by wwb17 with SMTP id 17so4486520wwb.12 for ; Sun, 01 May 2011 06:20:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.230.76 with SMTP id i54mr54944weq.108.1304256059279; Sun, 01 May 2011 06:20:59 -0700 (PDT) Received: by 10.216.13.207 with HTTP; Sun, 1 May 2011 06:20:59 -0700 (PDT) In-Reply-To: <20110429003231.GO19947@bubble.grove.modra.org> References: <20110428005642.GG19947@bubble.grove.modra.org> <20110429003231.GO19947@bubble.grove.modra.org> Date: Sun, 01 May 2011 13:21: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=ISO-8859-1 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/msg00002.txt.bz2 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. > after studying the section 3.6.4.1 about specifying files in the archives by writing a pattern. I changed my ld script as below and put some object files below link_folder: OUTPUT_ARCH(mips) ENTRY(entry) SECTIONS { .begin 0xbfb00000 : { *(.begin) . =3D ALIGN(8); _end_begin =3D ABSOLUTE(.); } .onlyText 0x80000000 : /*AT(_end_begin)*/ { link_folder: (*.text) lib1.a:(*.text) } .wholelib 0x81000000 : { lib2.a: } .text : { *(EXCLUDE_FILE (*.a ) .text)} .data : { *(EXCLUDE_FILE (*.a ) .data) } } # ls link_folder/ -lht total 12K -rw-r--r-- 1 root root 4.8K 2011-05-01 20:42 file1.o -rw-r--r-- 1 root root 3.7K 2011-05-01 20:42 main.o # I still cannot find the section name, onlyText and wholelib, in my elf content with link command as below: mipsel-linux-gnu-ld -T ./link.xn -o TEST_LINK.elf -Map TEST_LINK.map --oformat elf32-tradlittlemips lib1.a lib2.a file1.o main.o Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk I= nf Al [ 0] NULL 00000000 000000 000000 00 0 = 0 0 [ 1] .begin PROGBITS bfb00000 010000 000070 00 AX 0 = 0 4 [ 2] .text PROGBITS bfb00070 010070 0002a0 00 AX 0 = 0 16 [ 3] .reginfo MIPS_REGINFO bfb00310 010310 000018 18 A 0 = 0 4 [ 4] .rodata PROGBITS bfb00330 010330 000020 00 A 0 = 0 16 [ 5] .rodata.str1.4 PROGBITS bfb00350 010350 000014 01 AMS 0 = 0 4 [ 6] .bss NOBITS bfb00370 010364 000010 00 WA 0 = 0 16 [ 7] .pdr PROGBITS 00000000 010364 0000a0 00 0 = 0 4 [ 8] .comment PROGBITS 00000000 010404 00007a 00 0 = 0 1 [ 9] .gnu.attributes LOOS+ffffff5 00000000 01047e 000010 00 0 = 0 1 [10] .debug_abbrev MIPS_DWARF 00000000 01048e 000161 00 0 = 0 1 [11] .debug_info MIPS_DWARF 00000000 0105ef 0001eb 00 0 = 0 1 [12] .debug_line MIPS_DWARF 00000000 0107da 0000d0 00 0 = 0 1 [13] .debug_frame MIPS_DWARF 00000000 0108ac 000080 00 0 = 0 4 [14] .debug_loc MIPS_DWARF 00000000 01092c 00019c 00 0 = 0 1 [15] .debug_pubnames MIPS_DWARF 00000000 010ac8 000083 00 0 = 0 1 [16] .debug_aranges MIPS_DWARF 00000000 010b4b 000040 00 0 = 0 1 [17] .debug_str MIPS_DWARF 00000000 010b8b 000141 01 MS 0 = 0 1 [18] .debug_ranges MIPS_DWARF 00000000 010ccc 000018 00 0 = 0 1 [19] .shstrtab STRTAB 00000000 010ce4 0000e1 00 0 = 0 1 [20] .symtab SYMTAB 00000000 011138 0001d0 10 21 = 23 4 [21] .strtab STRTAB 00000000 011308 00007d 00 0 = 0 1 Key to Flags: --=20 Regards, miloody