Last active
January 12, 2022 00:57
-
-
Save mefellows/ac4e43c5d97fde40815ec6e29035af83 to your computer and use it in GitHub Desktop.
Shared library debugging tips
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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