Skip to content

Instantly share code, notes, and snippets.

@Scimmia22
Created June 30, 2017 18:33
Show Gist options
  • Save Scimmia22/0fcca58fe0f7c2b5eb906fafc1f32a62 to your computer and use it in GitHub Desktop.
Save Scimmia22/0fcca58fe0f7c2b5eb906fafc1f32a62 to your computer and use it in GitHub Desktop.
#!/bin/bash
workdir=$(mktemp -d)
bsdtar xf "$1" -C "$workdir"
while read file; do
liblist="$(objdump -p "$file" 2> /dev/null | grep -E "NEEDED\s+$2")"
[[ -n "$liblist" ]] && printf "%s\n%s\n" "${file#$workdir}" "$liblist" && found=1
done < <(find "$workdir" -type f)
[[ ! $found ]] && printf "No file in %s is linked to %s\n" "${1##*/}" "$2"
rm -rf "$workdir"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment