Skip to content

Instantly share code, notes, and snippets.

@milesrichardson
Created October 22, 2019 16:45
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save milesrichardson/984a045428cbcef1bf7635c922edba82 to your computer and use it in GitHub Desktop.
Function for finding where missing symbol is defined
# Usage: find_symbol _ZN6icu_608ByteSinkD2Ev
# Output list of files on system where given symbol exists
# Symbol should be formatted as given by output of ldd -r
find_symbol() {
local symbol="$1"
shift
while read -r filename ; do
readelf -Ws "$filename" 2>/dev/null | grep "$symbol" && echo "$filename" ;
done < <(find / -type f -name '*.so' -o -name '*.bc' -o -name '*.a')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment