3 # Copyright (C) 2012 OpenWrt.org
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
10 READELF="${READELF:-readelf}"
12 XARGS="${XARGS:-xargs -r}"
14 [ -z "$TARGETS" ] && {
15 echo "$SELF: no directories / files specified"
16 echo "usage: $SELF [PATH...]"
20 find $TARGETS -type f -a -exec file {} \; | \
21 sed -n -e 's/^\(.*\):.*ELF.*\(executable\|shared object\).*,.* stripped/\1/p' | \
22 $XARGS -n1 readelf -d | \
23 awk '$2 ~ /NEEDED/ && $NF !~ /interpreter/ && $NF ~ /^\[?lib.*\.so/ { gsub(/[\[\]]/, "", $NF); print $NF }' | \