sanity.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/bin/sh
  2. ### quick sanity test for the binutils.
  3. ###
  4. # This file was written K. Richard Pixley.
  5. # Copyright (C) 2007-2022 Free Software Foundation, Inc.
  6. # This program is part of GNU Binutils.
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 3 of the License, or
  10. # (at your option) any later version.
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
  18. # 02110-1301, USA. */
  19. ### fail on errors
  20. set -e
  21. ### first arg is directory in which binaries to be tested reside.
  22. case "$1" in
  23. "") BIN=. ;;
  24. *) BIN="$1" ;;
  25. esac
  26. ### size
  27. for i in size objdump nm ar strip ranlib ; do
  28. ${BIN}/size ${BIN}/$i > /dev/null
  29. done
  30. ### objdump
  31. for i in size objdump nm ar strip ranlib ; do
  32. ${BIN}/objdump -ahifdrtxsl ${BIN}/$i > /dev/null
  33. done
  34. ### nm
  35. for i in size objdump nm ar strip ranlib ; do
  36. ${BIN}/nm ${BIN}/$i > /dev/null
  37. done
  38. ### strip
  39. TMPDIR=./binutils-$$
  40. mkdir ${TMPDIR}
  41. cp ${BIN}/strip ${TMPDIR}/strip
  42. for i in size objdump nm ar ranlib ; do
  43. cp ${BIN}/$i ${TMPDIR}/$i
  44. ${BIN}/strip ${TMPDIR}/$i
  45. cp ${BIN}/$i ${TMPDIR}/$i
  46. ${TMPDIR}/strip ${TMPDIR}/$i
  47. done
  48. ### ar
  49. ### ranlib
  50. rm -rf ${TMPDIR}
  51. exit 0