tsan_rtl_s390x.S 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #include "sanitizer_common/sanitizer_asm.h"
  2. #define CFA_OFFSET 160
  3. #define R2_REL_OFFSET 16
  4. #define R3_REL_OFFSET 24
  5. #define R14_REL_OFFSET 112
  6. #define R15_REL_OFFSET 120
  7. #define FRAME_SIZE 160
  8. .text
  9. ASM_HIDDEN(__tsan_setjmp)
  10. .macro intercept symbol, real
  11. .comm \real, 8, 8
  12. .globl ASM_SYMBOL_INTERCEPTOR(\symbol)
  13. ASM_TYPE_FUNCTION(ASM_SYMBOL_INTERCEPTOR(\symbol))
  14. ASM_SYMBOL_INTERCEPTOR(\symbol):
  15. CFI_STARTPROC
  16. stmg %r2, %r3, R2_REL_OFFSET(%r15)
  17. CFI_REL_OFFSET(%r2, R2_REL_OFFSET)
  18. CFI_REL_OFFSET(%r3, R3_REL_OFFSET)
  19. stmg %r14, %r15, R14_REL_OFFSET(%r15)
  20. CFI_REL_OFFSET(%r14, R14_REL_OFFSET)
  21. CFI_REL_OFFSET(%r15, R15_REL_OFFSET)
  22. aghi %r15, -FRAME_SIZE
  23. CFI_ADJUST_CFA_OFFSET(FRAME_SIZE)
  24. la %r2, FRAME_SIZE(%r15)
  25. brasl %r14, ASM_SYMBOL(__tsan_setjmp)
  26. lmg %r14, %r15, FRAME_SIZE + R14_REL_OFFSET(%r15)
  27. CFI_RESTORE(%r14)
  28. CFI_RESTORE(%r15)
  29. CFI_DEF_CFA_OFFSET(CFA_OFFSET)
  30. lmg %r2, %r3, R2_REL_OFFSET(%r15)
  31. CFI_RESTORE(%r2)
  32. CFI_RESTORE(%r3)
  33. larl %r1, \real
  34. lg %r1, 0(%r1)
  35. br %r1
  36. CFI_ENDPROC
  37. ASM_SIZE(ASM_SYMBOL_INTERCEPTOR(\symbol))
  38. .endm
  39. intercept setjmp, _ZN14__interception11real_setjmpE
  40. intercept _setjmp, _ZN14__interception12real__setjmpE
  41. intercept sigsetjmp, _ZN14__interception14real_sigsetjmpE
  42. intercept __sigsetjmp, _ZN14__interception16real___sigsetjmpE
  43. NO_EXEC_STACK_DIRECTIVE