Skip to content

Instantly share code, notes, and snippets.

@mefellows
Last active January 12, 2022 00:57
Show Gist options
  • Save mefellows/ac4e43c5d97fde40815ec6e29035af83 to your computer and use it in GitHub Desktop.
Save mefellows/ac4e43c5d97fde40815ec6e29035af83 to your computer and use it in GitHub Desktop.
Shared library debugging tips
# Print out demangled symbols referenced in a library
nm -C myaddon.node
# list libraries another lib depends on
otool -L /path/to/lib.dylib # OSX
ldd /path/to/lib.so # linux
# List rpath of a library
# https://stackoverflow.com/questions/12521802/print-rpath-of-an-executable-on-macos
# https://www.lekensteyn.nl/rpath.html#what-is-rpath
otool -l /path/to/lib.dylib # OSX
readelf -d build/Release/pact.node | grep runpath # linux
# modify shared library
install_name_tool -change "foo.dylib" "/path/to/foo.dylib" /path/to/other.dylib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment