gensyminfo.sh.in 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #! @BUILD_SHEBANG@
  2. set -e
  3. # Copyright (C) 2010 Free Software Foundation, Inc.
  4. #
  5. # This gensymlist.sh is free software; the author
  6. # gives unlimited permission to copy and/or distribute it,
  7. # with or without modifications, as long as this notice is preserved.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  11. # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  12. # PARTICULAR PURPOSE.
  13. #
  14. # Example:
  15. #
  16. # gensyms.sh normal.module
  17. #
  18. module=$1
  19. modname=`echo $module | sed -e 's@\.module.*$@@'`
  20. # Print all symbols defined by module
  21. if test x"@TARGET_NMFLAGS_DEFINED_ONLY@" = x && test x"@TARGET_NMFLAGS_MINUS_P@" = x; then
  22. @TARGET_NM@ -g -p $module | \
  23. sed -n "s@^\([0-9a-fA-F]*\) *[TBRDS] *\([^ ]*\).*@defined $modname \2@p"
  24. elif test x"@TARGET_NMFLAGS_DEFINED_ONLY@" = x; then
  25. @TARGET_NM@ -g @TARGET_NMFLAGS_MINUS_P@ -p $module | \
  26. sed -n "s@^\([^ ]*\) *[TBRDS] *\([0-9a-fA-F]*\).*@defined $modname \1@p"
  27. else
  28. @TARGET_NM@ -g --defined-only @TARGET_NMFLAGS_MINUS_P@ -p $module | \
  29. sed "s@^\([^ ]*\).*@defined $modname \1@g"
  30. fi
  31. # Print all undefined symbols used by module
  32. @TARGET_NM@ -u @TARGET_NMFLAGS_MINUS_P@ -p $module | sed "s@^\([^ ]*\).*@undefined $modname \1@g"