thumb_bl_out_of_range_local.s 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # thumb_bl_out_of_range_local.s
  2. # Test THUMB/THUMB-2 bl instructions just out of the branch range limits
  3. # and with local branch targets.
  4. .syntax unified
  5. .section .text.pre,"x"
  6. # Add padding so that target is just output of branch range.
  7. .space 6
  8. .code 16
  9. .thumb_func
  10. .type .Lbackward_target, %function
  11. .Lbackward_target:
  12. bx lr
  13. .size .Lbackward_target, .-.Lbackward_target
  14. .text
  15. # Use 256-byte alignment so that we know where the stubs start.
  16. .align 8
  17. # Define _start so that linker does not complain.
  18. .global _start
  19. .code 32
  20. .align 2
  21. .type _start, %function
  22. _start:
  23. bx lr
  24. .size _start, .-_start
  25. .global _backward_test
  26. .code 16
  27. .thumb_func
  28. .type _backward_test, %function
  29. _backward_test:
  30. bl .Lbackward_target
  31. .size _backward_test, .-_backward_test
  32. .global _forward_test
  33. .code 16
  34. .thumb_func
  35. .type _forward_test, %function
  36. _forward_test:
  37. bl .Lforward_target
  38. .size _forward_test, .-_forward_test
  39. # Switch back to ARM mode so that we can see stubs
  40. .align 2
  41. .code 32
  42. # Align stub table for address matching.
  43. .align 8
  44. .section .text.post,"x"
  45. # Add padding so that target is just out of branch range.
  46. .space 12
  47. .code 16
  48. .thumb_func
  49. .type .Lforward_target, %function
  50. .Lforward_target:
  51. bx lr
  52. .size .Lforward_target, .-.Lforward_target