script_test_9.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/sh
  2. # script_test_9.sh -- Check that the script_test_9.t script has placed
  3. # .init and .text in the same segment.
  4. # Copyright (C) 2010-2015 Free Software Foundation, Inc.
  5. # Written by Rafael Avila de Espindola <espindola@google.com>.
  6. # This file is part of gold.
  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,
  18. # MA 02110-1301, USA.
  19. check()
  20. {
  21. if ! grep -q "$2" "$1"
  22. then
  23. echo "Did not find expected section in $1:"
  24. echo " $2"
  25. echo ""
  26. echo "Actual output below:"
  27. cat "$1"
  28. exit 1
  29. fi
  30. }
  31. check script_test_9.stdout "LOAD .*R E "
  32. check script_test_9.stdout "LOAD .*RW "
  33. check script_test_9.stdout "00 .*\.text .init"
  34. check script_test_9.stdout "01 .*\.data "