unreferenced local symbols generated in .dynsym

Roland McGrath roland@redhat.com
Wed Apr 23 06:23:00 GMT 2003


Doing:

    gcc -x c /dev/null -shared -nostdlib -o null.so -s
    readelf -Wsr null.so

shows:

    There are no relocations in this file.

    Symbol table '.dynsym' contains 15 entries:
       Num:    Value  Size Type    Bind   Vis      Ndx Name
	 0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
	 1: 00000094     0 SECTION LOCAL  DEFAULT    1 
	 2: 000000e4     0 SECTION LOCAL  DEFAULT    2 
	 3: 000001d4     0 SECTION LOCAL  DEFAULT    3 
	 4: 0000020c     0 SECTION LOCAL  DEFAULT    4 
	 5: 0000120c     0 SECTION LOCAL  DEFAULT    5 
	 6: 0000120c     0 SECTION LOCAL  DEFAULT    6 
	 7: 00001264     0 SECTION LOCAL  DEFAULT    7 
	 8: 00001270     0 SECTION LOCAL  DEFAULT    8 
	 9: 00000000     0 SECTION LOCAL  DEFAULT    9 
	10: 0000120c     0 OBJECT  GLOBAL DEFAULT  ABS _DYNAMIC
	11: 00001270     0 NOTYPE  GLOBAL DEFAULT  ABS __bss_start
	12: 00001270     0 NOTYPE  GLOBAL DEFAULT  ABS _edata
	13: 00001264     0 OBJECT  GLOBAL DEFAULT  ABS _GLOBAL_OFFSET_TABLE_
	14: 00001270     0 NOTYPE  GLOBAL DEFAULT  ABS _end

There should never be local symbols in .dynsym unless they are referenced
by dynamic relocs.  Other superfluous symbols like the FILE symbol got
removed, but the section symbols remain no matter what I do.  This is buggy.



More information about the Binutils mailing list