From: loody <miloody@gmail.com>
To: binutils@sourceware.org, amodra@gmail.com
Subject: Re: some question about output section
Date: Sun, 01 May 2011 13:21:00 -0000 [thread overview]
Message-ID: <BANLkTin7UtPRsk4s=J1TXyARzgEhOODL5w@mail.gmail.com> (raw)
In-Reply-To: <20110429003231.GO19947@bubble.grove.modra.org>
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.
>
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)
. = ALIGN(8);
_end_begin = 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 Inf 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:
--
Regards,
miloody
next prev parent reply other threads:[~2011-05-01 13:21 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 [this message]
2011-05-04 15:51 ` loody
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='BANLkTin7UtPRsk4s=J1TXyARzgEhOODL5w@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).