3
# The first argument specifies the toolchain prefix.
4
# If the second argument is "defined", list all symbols defined in these files.
5
# If the second argument is "undefined", list all external dependencies.
6
# Read all symbols for all files specified in the remaining arguments.
7
# Sort, remove duplicates.
12
if [ "$2" = "defined" ]
14
GREP="grep -v" # Filter out lines with "UND" in them
15
elif [ "$2" = "undefined" ]
17
GREP="grep" # Keep only lines with "UND" in them
19
echo "Please specify 'defined' or 'undefined'" >&2
23
# Get rid of arguments 1 and 2.
27
# Call readelf, process output.
28
"${TOOLCHAIN_PREFIX}readelf" -sW $* |
29
egrep '[[:digit:]]+:' |