arm_unaligned_reloc.sh 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/sh
  2. # arm_unaligned_reloc.sh -- test ARM unaligned static data relocations.
  3. # Copyright (C) 2011-2014 Free Software Foundation, Inc.
  4. # Written by Doug Kwan <dougkwan@google.com>
  5. # This file is part of gold.
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 3 of the License, or
  9. # (at your option) any later version.
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
  17. # MA 02110-1301, USA.
  18. # This file goes with the assembler source file arm_unaligned_reloc.s,
  19. # that is assembled and linked as a dummy executable. We want to check
  20. # it is okay to do unaligned static data relocations.
  21. check()
  22. {
  23. if ! grep -q -e "$2" "$1"
  24. then
  25. echo "Did not find pattern \"$2\" in $1:"
  26. echo " $2"
  27. echo ""
  28. echo "Actual disassembly below:"
  29. cat "$1"
  30. exit 1
  31. fi
  32. }
  33. check arm_unaligned_reloc.stdout "^00009000 <x>:$"
  34. check arm_unaligned_reloc.stdout "^0000a001 <abs32>:$"
  35. check arm_unaligned_reloc.stdout '^[ ]*a001:[ ]*00009001[ ].*$'
  36. check arm_unaligned_reloc.stdout "^0000a005 <rel32>:"
  37. check arm_unaligned_reloc.stdout "^[ ]*a005:[ ]*ffffeffc[ ].*$"
  38. check arm_unaligned_reloc.stdout "^0000a009 <abs16>:"
  39. check arm_unaligned_reloc.stdout "^[ ]*a009:[ ]*00009001[ ].*$"
  40. check arm_unaligned_reloc_r.stdout "^[ ]*1:[ ]*00000001[ ].*$"
  41. check arm_unaligned_reloc_r.stdout "^[ ]*1: R_ARM_ABS32[ ]*.data.0$"
  42. check arm_unaligned_reloc_r.stdout "^[ ]*5:[ ]*00000001[ ].*$"
  43. check arm_unaligned_reloc_r.stdout "^[ ]*5: R_ARM_REL32[ ]*.data.0$"
  44. check arm_unaligned_reloc_r.stdout "^[ ]*9:[ ]*00000001[ ].*$"
  45. check arm_unaligned_reloc_r.stdout "^[ ]*9: R_ARM_ABS16[ ]*.data.0$"
  46. exit 0