[GOLD] Does gold strip the "SECTION SYMBOL" by default ?

Shawn shaolin.xie@ia.ac.cn
Sat Jun 22 03:17:00 GMT 2013


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.





More information about the Binutils mailing list