This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[GOLD] Does gold strip the "SECTION SYMBOL" by default ?
- From: Shawn <shaolin dot xie at ia dot ac dot cn>
- To: binutils at sourceware dot org
- Cc: Triple Yang <triple dot yang at gmail dot com>, "Lei.Wang" <lei dot wang dot left at gmail dot com>
- Date: Sat, 22 Jun 2013 11:17:35 +0800
- Subject: [GOLD] Does gold strip the "SECTION SYMBOL" by default ?
Hi All:
I'm trying to link the object files compiled by LLVM using GOLD ,
but found the "SECTION SYMBOL" have been stripped in the ELF file, for
example:
=================================================
= This is the object file with the "SECTION SYMBOL"
[xiesl@aurora-hp AGUTest]$ readelf -s app.s.o
Symbol table '.symtab' contains 5 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 00000000 0 SECTION LOCAL DEFAULT 1
2: 00000000 0 SECTION LOCAL DEFAULT 2
3: 00000000 0 SECTION LOCAL DEFAULT 3
4: 00000010 0 NOTYPE GLOBAL DEFAULT 1 _start
=================================================
= This is the executable file without the "SECTION SYMBOL"
[xiesl@aurora-hp AGUTest]$ /home/xiesl/tools/mapu-llvm/bin/ld.gold -T
Script.ld app.s.o -o app.s.out
[xiesl@aurora-hp AGUTest]$ readelf -s app.s.out
Symbol table '.symtab' contains 3 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 00000010 0 NOTYPE GLOBAL DEFAULT 1 _start
2: 00040000 0 NOTYPE GLOBAL DEFAULT ABS STACK_POINTER
=================================================
= This is the link script
[xiesl@aurora-hp AGUTest]$ cat Script.ld
MEMORY {
RAM : ORIGIN = 0x0, LENGTH = 0x40000
}
/* All text code & data are in IM */
SECTIONS {
.text : { *(.text) }
.data : { *(.data) }
.bss : { *(.bss ) }
}
/* The Stack Pointer */
STACK_POINTER = 0x40000;
=================================================
What can I do to preserve the "SECTION SYMBOL" in the output file ? Do I
need to modify the source code of gold?
Kind Regards.
Shawn.