Skip to content
An example of Linux/glibc symbol versioning
C Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
caller.2.c
caller.c
foo.2.c
foo.c
makefile
symver.2.map
symver.map

README.md

symbolversioning

An example of Linux/glibc symbol versioning.

demo:

$ make rm -f libfoo.1.so cc foo.c -g -Wl,--version-script=symver.map -fpic -o libfoo.1.so -Wl,-soname,libfoo.so -shared rm -f libfoo.so ln -s libfoo.1.so libfoo.so cc caller.c -g -Wl,-rpath,pwd -o caller1 -lfoo -L.

$ ./caller1 foo@@V1: 1

$ nm caller1 | grep foo U foo@@MYSTUFF_1.1 $ make v2 rm -f libfoo.2.so cc foo.2.c -g -Wl,--version-script=symver.2.map -fpic -o libfoo.2.so -Wl,-soname,libfoo.so -shared rm -f libfoo.so ln -s libfoo.2.so libfoo.so cc caller.2.c -g -Wl,-rpath,pwd -o caller2 -lfoo -L.

$ ./caller1 foo@@V1: 1

$ ./caller2 foo@@V2: 1 2 $ nm caller2 | grep foo U foo@@MYSTUFF_1.2

You can’t perform that action at this time.