Re: Hiding symbols in DSOs
- From: Paul Pluzhnikov <ppluzhnikov-nsp@xxxxxxxxxxx>
- Date: Sat, 03 Nov 2007 07:16:42 -0700
gga <GGarramuno@xxxxxxx> writes:
By using strip and -fvisibility=hidden, I can most symbols from my own....
code under all circumstances.
But I am unable to hide the symbols from the licensing library, when I
Probably because these symbols were not marked hidden.
Somehow gcc seems to think the symbols need to be exposed.
You didn't tell it otherwise, why should it think differently?
I am
looking for an easy way to strip the symbols from this static library
using either strip or during the compile/linking phase.
Use linker script to localize all undesirable symbols:
$ cat junk.c
void license_foo() { }
void license_bar() { }
void client_api() { }
$ cat junk.lds
MYLIB {
local:
license*;
};
$ gcc -shared -fPIC junk.c -Wl,--version-script,junk.lds -o junk.so && strip junk.so
$ nm -D junk.so | egrep 'license|client'
0000000000000844 T client_api
$ nm junk.so
nm: junk.so: no symbols
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
.
- Follow-Ups:
- Re: Hiding symbols in DSOs
- From: gga
- Re: Hiding symbols in DSOs
- References:
- Hiding symbols in DSOs
- From: gga
- Hiding symbols in DSOs
- Prev by Date: Hiding symbols in DSOs
- Next by Date: Debugging core file?
- Previous by thread: Hiding symbols in DSOs
- Next by thread: Re: Hiding symbols in DSOs
- Index(es):
Relevant Pages
|