bsd-_setjmp.S 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. ARM version.
  2. Copyright (C) 1997, 1998 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <http://www.gnu.org/licenses/>. */
  15. #include <bits/arm_asm.h>
  16. /* This just does a tail-call to `__sigsetjmp (ARG, 0)'.
  17. We cannot do it in C because it must be a tail-call, so frame-unwinding
  18. in setjmp doesn't clobber the state restored by longjmp. */
  19. .global _setjmp
  20. .type _setjmp,%function
  21. .align 2
  22. #if defined(THUMB1_ONLY)
  23. .thumb_func
  24. _setjmp:
  25. mov r1, #0
  26. #ifdef __PIC__
  27. ldr r3, .L_GOT
  28. adr r2, .L_GOT
  29. add r3, r2, r3
  30. ldr r2, .L_GOT+4 /* __sigsetjmp */
  31. ldr r2, [r2, r3]
  32. bx r2
  33. .align 2
  34. .L_GOT:
  35. .word _GLOBAL_OFFSET_TABLE_-.L_GOT
  36. .word __sigsetjmp(GOT)
  37. #else
  38. ldr r2, =__sigsetjmp
  39. bx r2
  40. .pool
  41. #endif
  42. #else
  43. _setjmp:
  44. mov r1, #0
  45. #ifdef __PIC__
  46. b __sigsetjmp(PLT)
  47. #else
  48. b __sigsetjmp
  49. #endif
  50. #endif
  51. .size _setjmp,.-_setjmp