This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: removing symbol from partially linked object file
- From: Erik Leunissen <e dot leunissen at hccnet dot nl>
- To: binutils at sourceware dot org
- Date: Wed, 15 Nov 2006 00:05:14 +0100
- Subject: Re: removing symbol from partially linked object file
- References: <455A4A8B.8090706@hccnet.nl>
(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
>