This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Can't discard .symtab?
- From: John Levon <levon at movementarian dot org>
- To: binutils at sourceware dot org
- Date: Tue, 6 Feb 2007 19:20:38 +0000
- Subject: Can't discard .symtab?
$ 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