Skip to content

Latest commit

 

History

History
10 lines (8 loc) · 499 Bytes

RenameLibraryInterface.md

File metadata and controls

10 lines (8 loc) · 499 Bytes

Sometimes you may need to rename API of existing shared library to avoid name clashes.

To achieve this you can generate a wrapper with renamed symbols which call to old, non-renamed symbols in original library loaded via dlmopen instead of dlopen (to avoid polluting global namespace):

$ cat mycallback.c
... Same as before ...
$ implib-gen.py --dlopen-callback=mycallback --symbol_prefix=MYPREFIX_ libxyz.so
$ ... # Link your app with libxyz.tramp.S, libxyz.init.c and mycallback.c