Skip to content

Instantly share code, notes, and snippets.

@mheffner
Created August 19, 2009 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mheffner/170597 to your computer and use it in GitHub Desktop.
Save mheffner/170597 to your computer and use it in GitHub Desktop.
$ make libab.so
gcc -Wall -fPIC -fvisibility=hidden -c -o filea.o filea.c
gcc -Wall -fPIC -fvisibility=hidden -c -o fileb.o fileb.c
gcc -Wall -fPIC -fvisibility=hidden -shared -o libab.so filea.o fileb.o
$ strip --strip-all --discard-all libab.so
$ objdump -T libab.so | grep get
0000000000000587 g DF .text 000000000000004a Base ab_get_string
$ LD_LIBRARY_PATH=. ./test
String: A val: 3, B val: 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment