2017-01-22 17:22:34 +00:00
|
|
|
#! @BUILD_SHEBANG@
|
2011-05-18 11:53:07 +00:00
|
|
|
set -e
|
|
|
|
|
2010-08-29 05:47:30 +00:00
|
|
|
# Copyright (C) 2010 Free Software Foundation, Inc.
|
|
|
|
#
|
|
|
|
# This gensymlist.sh is free software; the author
|
|
|
|
# gives unlimited permission to copy and/or distribute it,
|
|
|
|
# with or without modifications, as long as this notice is preserved.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|
|
|
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
|
|
# PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
|
|
|
# gensyms.sh normal.module
|
|
|
|
#
|
|
|
|
|
|
|
|
module=$1
|
|
|
|
modname=`echo $module | sed -e 's@\.module.*$@@'`
|
|
|
|
|
|
|
|
# Print all symbols defined by module
|
2013-11-11 22:05:53 +00:00
|
|
|
if test x"@TARGET_NMFLAGS_DEFINED_ONLY@" = x && test x"@TARGET_NMFLAGS_MINUS_P@" = x; then
|
|
|
|
@TARGET_NM@ -g -p $module | \
|
2013-08-21 23:56:28 +00:00
|
|
|
sed -n "s@^\([0-9a-fA-F]*\) *[TBRDS] *\([^ ]*\).*@defined $modname \2@p"
|
2013-11-11 22:05:53 +00:00
|
|
|
elif test x"@TARGET_NMFLAGS_DEFINED_ONLY@" = x; then
|
|
|
|
@TARGET_NM@ -g @TARGET_NMFLAGS_MINUS_P@ -p $module | \
|
|
|
|
sed -n "s@^\([^ ]*\) *[TBRDS] *\([0-9a-fA-F]*\).*@defined $modname \1@p"
|
2010-08-29 05:47:30 +00:00
|
|
|
else
|
2013-08-21 23:56:28 +00:00
|
|
|
@TARGET_NM@ -g --defined-only @TARGET_NMFLAGS_MINUS_P@ -p $module | \
|
2010-08-29 05:47:30 +00:00
|
|
|
sed "s@^\([^ ]*\).*@defined $modname \1@g"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Print all undefined symbols used by module
|
2013-08-21 23:56:28 +00:00
|
|
|
@TARGET_NM@ -u @TARGET_NMFLAGS_MINUS_P@ -p $module | sed "s@^\([^ ]*\).*@undefined $modname \1@g"
|