Skip to content
shared library stub generator for Unix-like OSes
Perl C C++
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
so-stub
stubs.c
stubs.cpp

README.md

Code is of prototype quality!

Usage

./so-stub caller so lang

  • caller: full path to an executable or a shared library which uses so (directly or indirectly);
  • so: shared library (.so) to stub; can be a full library file name or a distinguishable prefix;
  • lang: either c or cpp.

Examples

$ ./so-stub /usr/bin/dwdiff libicuuc c
P: Processing dynamic dependencies of /usr/bin/dwdiff ...
I: Will create a stub library for libicuuc (libicuuc.so.57) used in /usr/bin/dwdiff
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libicui18n.so.57 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libicudata.so.57 ...
P: Reading symbol table of /lib/x86_64-linux-gnu/libc.so.6 ...
P: Reading symbol table of /lib/x86_64-linux-gnu/libpthread.so.0 ...
P: Reading symbol table of /lib/x86_64-linux-gnu/libdl.so.2 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ...
P: Reading symbol table of /lib/x86_64-linux-gnu/libm.so.6 ...
P: Reading symbol table of /lib/x86_64-linux-gnu/libgcc_s.so.1 ...
P: Reading symbol table of /usr/bin/dwdiff ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libicuuc.so.57 ...
I: Used symbols: 635, unused symbols: 2652
I: Output file: libicuuc.so.57
I: Stub function name: so_stub_for_libicuuc
I: Using C stubs - library function stubs will call abort()
I:   -> check for environment variable 'so_stub_for_libicuuc' before using the library
P: Compiling ...
P: Stripping ...
I: Done
$ ./so-stub /usr/bin/qtcreator libQt5Qml cpp
P: Processing dynamic dependencies of /usr/bin/qtcreator ...
I: Will create a stub library for libQt5Qml (libQt5Qml.so.5) used in /usr/bin/qtcreator
P: Reading symbol table of /usr/bin/../lib/x86_64-linux-gnu/qtcreator/libExtensionSystem.so.4 ...
P: Reading symbol table of /usr/bin/../lib/x86_64-linux-gnu/qtcreator/libUtils.so.4 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libQt5Network.so.5 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 ...
P: Reading symbol table of /lib/x86_64-linux-gnu/libpthread.so.0 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ...
P: Reading symbol table of /lib/x86_64-linux-gnu/libgcc_s.so.1 ...
P: Reading symbol table of /lib/x86_64-linux-gnu/libc.so.6 ...
P: Reading symbol table of /lib/x86_64-linux-gnu/libm.so.6 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 ...
P: Reading symbol table of /lib/x86_64-linux-gnu/libz.so.1 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libGL.so.1 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libpng16.so.16 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libproxy.so.1 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libicui18n.so.57 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libicuuc.so.57 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libpcre16.so.3 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libdouble-conversion.so.1 ...
P: Reading symbol table of /lib/x86_64-linux-gnu/libdl.so.2 ...
P: Reading symbol table of /lib/x86_64-linux-gnu/libglib-2.0.so.0 ...
P: Reading symbol table of /lib/x86_64-linux-gnu/librt.so.1 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libfreetype.so.6 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 ...
P: Reading symbol table of /lib/x86_64-linux-gnu/libexpat.so.1 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libxcb-present.so.0 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libxshmfence.so.1 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libglapi.so.0 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libXext.so.6 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libXdamage.so.1 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libXfixes.so.3 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libX11.so.6 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libxcb.so.1 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libdrm.so.2 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libicudata.so.57 ...
P: Reading symbol table of /lib/x86_64-linux-gnu/libpcre.so.3 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libXau.so.6 ...
P: Reading symbol table of /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 ...
P: Reading symbol table of /usr/bin/qtcreator ...
P: Reading symbol table of /usr/bin/../lib/x86_64-linux-gnu/qtcreator/../libQt5Qml.so.5 ...
I: Used symbols: 11, unused symbols: 3513
I: Output file: libQt5Qml.so.5
I: Stub function name: so_stub_for_libQt5Qml
I: Using C++ stubs - library function stubs will throw std::runtime_error
I:   -> catch this exception in the code to make the library optional
P: Compiling ...
P: Stripping ...
I: Done

License

MIT

You can’t perform that action at this time.