property-bti-pac2.s 901 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. .text
  2. .global foo
  3. .type foo, %function
  4. foo:
  5. sub sp, sp, #16
  6. mov w0, 9
  7. str w0, [sp, 12]
  8. ldr w0, [sp, 12]
  9. add w0, w0, 4
  10. str w0, [sp, 12]
  11. nop
  12. add sp, sp, 16
  13. ret
  14. .size foo, .-foo
  15. .global bar
  16. .type bar, %function
  17. .ifdef __property_bti__
  18. .section ".note.gnu.property", "a"
  19. .p2align 3
  20. .long 1f - 0f /* name length */
  21. .long 5f - 2f /* data length */
  22. .long 5 /* note type */
  23. 0: .asciz "GNU" /* vendor name */
  24. 1:
  25. .p2align 3
  26. 2: .long 0xc0000000 /* pr_type. */
  27. .long 4f - 3f /* pr_datasz. */
  28. 3:
  29. .long 0x1 /* BTI. */
  30. 4:
  31. .p2align 3
  32. 5:
  33. .endif
  34. .ifdef __property_pac__
  35. .section ".note.gnu.property", "a"
  36. .p2align 3
  37. .long 1f - 0f /* name length */
  38. .long 5f - 2f /* data length */
  39. .long 5 /* note type */
  40. 0: .asciz "GNU" /* vendor name */
  41. 1:
  42. .p2align 3
  43. 2: .long 0xc0000000 /* pr_type. */
  44. .long 4f - 3f /* pr_datasz. */
  45. 3:
  46. .long 0x2 /* PAC. */
  47. 4:
  48. .p2align 3
  49. 5:
  50. .endif