Discussion:
objdump or nm exported symbols (was: Linker exposing private symbols)
Jeffrey Walton
2018-08-27 12:04:17 UTC
Permalink
...
$ g++ -o sha256_wrapper.so -g2 -O3 -shared -fPIC -ffunction-sections
-fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden
sha256_wrapper.o ./libcryptopp.a -Wl,--gc-sections
$ nm -gCD sha256_wrapper.so | grep ' T ' | wc -l
Alan, Since I have you on the line...

Is there a more succinct way to objdump or nm only exported symbols,
without warts like:

nm -gCD sha256_wrapper.so | grep ' T '

Jeff
Nick Clifton
2018-09-03 14:58:34 UTC
Permalink
Hi Jeff,
Post by Jeffrey Walton
Alan, Since I have you on the line...
Is there a more succinct way to objdump or nm only exported symbols,
nm -gCD sha256_wrapper.so | grep ' T '
[replying for Alan since he is probably very busy].

No. :-(

Probably the closest that you will get is:

nm --defined-only --extern-only <foo>

But this will include exported data symbols as well as function symbols.

Cheers
Nick
Jeffrey Walton
2018-09-03 15:21:15 UTC
Permalink
Post by Nick Clifton
Hi Jeff,
Post by Jeffrey Walton
Alan, Since I have you on the line...
Is there a more succinct way to objdump or nm only exported symbols,
nm -gCD sha256_wrapper.so | grep ' T '
[replying for Alan since he is probably very busy].
No. :-(
nm --defined-only --extern-only <foo>
But this will include exported data symbols as well as function symbols.
Ack, thanks.

Jeff

Loading...