Last active
August 30, 2017 18:15
-
-
Save errzey/4563084e39f9a891bdc2dc3ea8b5e05d to your computer and use it in GitHub Desktop.
stupid shell script that tries to find a specific symbol in libs.
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
#!/usr/bin/env bash | |
# runs through your ld paths and looks for a symbol | |
# passed as the first argument | |
# | |
# example: | |
# | |
# $ ./lz.findsymbol.sh xcb_big_requests_id | |
# /usr/lib/x86_64-linux-gnu/libcairo.a | |
# /usr/lib/x86_64-linux-gnu/libxcb.a | |
symbol=$1 | |
for dir in `cat /etc/ld.so.conf.d/* | grep -v '#'` | |
do | |
for file in $dir/*.a | |
do | |
nm --defined-only -g -C $file 2>/dev/null | grep -q $symbol && \ | |
echo $dir/`basename $file` | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment