removing symbol from shared lib
Erik Leunissen
e.leunissen@hccnet.nl
Tue Nov 14 22:24:00 GMT 2006
To answer my own question:
Yes it is possible with the minimal setup below. It just doesn't work in
a more complicated real world case, which doesn't lend itself for public
consumption (yet).
Erik Leunissen
==============
> cat a.c
void
X ()
{
}
> cat b.c
extern void X();
void
Y ()
{
X();
}
> gcc -c a.c b.c
> gcc -shared -nostdlib -o ab.so a.o b.o
> nm ab.so
00001328 A __bss_start
000012a4 A _DYNAMIC
00001328 A _edata
00001328 A _end
0000131c A _GLOBAL_OFFSET_TABLE_
0000028c T X
00000294 T Y
> objcopy -L X ab.so
> nm ab.so
00001328 A __bss_start
000012a4 A _DYNAMIC
00001328 A _edata
00001328 A _end
0000131c A _GLOBAL_OFFSET_TABLE_
0000028c t X
00000294 T Y
> objcopy -x ab.so
> nm ab.so
00001328 A __bss_start
000012a4 A _DYNAMIC
00001328 A _edata
00001328 A _end
0000131c A _GLOBAL_OFFSET_TABLE_
00000294 T Y
>
More information about the Binutils
mailing list