Can't discard .symtab?

John Levon levon@movementarian.org
Tue Feb 6 19:56:00 GMT 2007


$ readelf -S a.o | grep .symtab
  [ 9] .symtab           SYMTAB           0000000000000000  000003f0
[moz@pent ~]$ cat a.lds
SECTIONS
{
 /DISCARD/ : {
    *(.note.GNU-stack)
    *(.strtab)
    *(.symtab)
 }
}
[moz@pent ~]$ ld -o a -T a.lds a.o
[moz@pent ~]$ readelf -S a | grep .symtab
  [ 7] .symtab           SYMTAB           0000000000000000  00100318
[moz@pent ~]$

.note.GNU-stack was successfully discarded, but I couldn't get rid of
.symtab or .strtab. Am I missing something obvious here? Similarly I
can't get ld to output .symtab in a new section e.g.:

  .foo : { *(.strtab) }

$ ld --version
GNU ld version 2.15.94.0.2.2 20041220

(What I really want to do is assign both sections to a particular
phdr... that doesn't work either, not does objcopy renaming or copying)
 
thanks,
john



More information about the Binutils mailing list