Skip to content

Instantly share code, notes, and snippets.

@akawashiro
Created September 12, 2020 05:40
Show Gist options
  • Save akawashiro/5b1834a581bd050421e69fa4b6f726e9 to your computer and use it in GitHub Desktop.
Save akawashiro/5b1834a581bd050421e69fa4b6f726e9 to your computer and use it in GitHub Desktop.
#! /bin/bash
# This shellscript find all shared object which contains the specified symbol.
sym=$1
sos=`ldconfig -p | awk -F '=>' '{print $2}' | grep so | sort | uniq`
for s in ${sos}
do
PRE_IFS=$IFS
IFS=$'\n'
for l in `readelf -s $s | grep -e ${sym} | grep -v UND`
do
echo ${l} in ${s}
done
IFS=$PRE_IFS
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment