removing symbol from partially linked object file

Erik Leunissen e.leunissen@hccnet.nl
Tue Nov 14 23:05:00 GMT 2006


(Sorry for the first post, where the mail program clobbered the ">" 
symbols. Here's the correct version, reposted for readability reasons)


Why isn't the symbol X removed in this case?

 > cat a.c
void
X ()
{
}
 > cat b.c
extern void X();
void
Y ()
{
X();
}
 > gcc -c a.c b.c
 > ld -r -nostdlib -o ab.o a.o b.o
 > /usr/local/src/binutils-2.17/binutils/objcopy -L X ab.o
 > nm ab.o
00000000 t X
00000008 T Y
 > /usr/local/src/binutils-2.17/binutils/objcopy -x ab.o
 > nm ab.o
00000000 t X
00000008 T Y
 >



More information about the Binutils mailing list