thumb_bl_in_range.s 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # thumb_bl_in_range.s
  2. # Test THUMB/THUMB-2 bl instructions just within the branch range limits.
  3. .syntax unified
  4. .section .text.pre,"x"
  5. # Add padding so that target is just in branch range.
  6. .space 8
  7. .global _backward_target
  8. .code 16
  9. .thumb_func
  10. .type _backword_target, %function
  11. _backward_target:
  12. bx lr
  13. .size _backward_target, .-_backward_target
  14. .text
  15. # Define _start so that linker does not complain.
  16. .global _start
  17. .code 32
  18. .align 2
  19. .type _start, %function
  20. _start:
  21. bx lr
  22. .size _start, .-_start
  23. .global _backward_test
  24. .code 16
  25. .thumb_func
  26. .type _backward_test, %function
  27. _backward_test:
  28. bl _backward_target
  29. .size _backward_test, .-_backward_test
  30. .global _forward_test
  31. .code 16
  32. .thumb_func
  33. .type _forward_test, %function
  34. _forward_test:
  35. bl _forward_target
  36. .size _forward_test, .-_forward_test
  37. .section .text.post,"x"
  38. # Add padding so that target is just in branch range.
  39. .space 10
  40. .global _forward_target
  41. .code 16
  42. .thumb_func
  43. .type _forward_target, %function
  44. _forward_target:
  45. bx lr
  46. .size _forward_target, .-_forward_target