script_test_8.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/sh
  2. # script_test_8.sh -- test for SEGMENT_START expressions with
  3. # -Ttext, -Tdata and -Tbss in a script.
  4. # Copyright (C) 2009-2015 Free Software Foundation, Inc.
  5. # Written by Doug Kwan <dougkwan@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. # This file goes with script_test_4.t, which is a linker script which
  20. # starts the program at an unaligned address.
  21. check()
  22. {
  23. if ! grep -q "$2" "$1"
  24. then
  25. echo "Did not find expected section in $1:"
  26. echo " $2"
  27. echo ""
  28. echo "Actual output below:"
  29. cat "$1"
  30. exit 1
  31. fi
  32. }
  33. check script_test_8.stdout "\\.interp[ ]*PROGBITS[ ]*0*20001000"
  34. check script_test_8.stdout "\\.data[ ]*PROGBITS[ ]*0*20200000"
  35. check script_test_8.stdout "\\.bss[ ]*NOBITS[ ]*0*2040...."