incompatible with executable-only code.
ok deraadt@, guenther@
-/* $OpenBSD: _setjmp.S,v 1.5 2022/05/24 22:35:27 guenther Exp $ */
+/* $OpenBSD: _setjmp.S,v 1.6 2022/12/24 10:49:19 kettenis Exp $ */
/*-
* Copyright (c) 2014 Andrew Turner
* Copyright (c) 2014 The FreeBSD Foundation
ENTRY(_setjmp)
RETGUARD_SETUP(_setjmp, x15)
/* Store the magic value and stack pointer */
- ldr x8, .Lmagic
+ movz x8, #(_JB_MAGIC__SETJMP & 0xffff)
+ movk x8, #(_JB_MAGIC__SETJMP >> 16), lsl #16
mov x9, sp
stp x8, x9, [x0], #16
mov x0, #0
RETGUARD_CHECK(_setjmp, x15)
ret
- .align 3
-.Lmagic:
- .quad _JB_MAGIC__SETJMP
END_STRONG(_setjmp)
ENTRY(_longjmp)
RETGUARD_LOAD_RANDOM(_longjmp, x15)
/* Check the magic value */
ldr x8, [x0], #8
- ldr x9, .Lmagic
+ movz x9, #(_JB_MAGIC__SETJMP & 0xffff)
+ movk x9, #(_JB_MAGIC__SETJMP >> 16), lsl #16
cmp x8, x9
b.ne .Lbotch
-/* $OpenBSD: setjmp.S,v 1.5 2022/05/24 22:35:27 guenther Exp $ */
+/* $OpenBSD: setjmp.S,v 1.6 2022/12/24 10:49:19 kettenis Exp $ */
/*-
* Copyright (c) 2014 Andrew Turner
* Copyright (c) 2014 The FreeBSD Foundation
mov x0, x2
/* Store the magic value and stack pointer */
- ldr x8, .Lmagic
+ movz x8, #(_JB_MAGIC_SETJMP & 0xffff)
+ movk x8, #(_JB_MAGIC_SETJMP >> 16), lsl #16
mov x9, sp
stp x8, x9, [x0], #16
mov x0, #0
RETGUARD_CHECK(setjmp, x15)
ret
-
- .align 3
-.Lmagic:
- .quad _JB_MAGIC_SETJMP
END_STRONG(setjmp)
ENTRY(longjmp)
mov x0, x2
/* Check the magic value */
ldr x8, [x0], #8
- ldr x9, .Lmagic
+ movz x9, #(_JB_MAGIC_SETJMP & 0xffff)
+ movk x9, #(_JB_MAGIC_SETJMP >> 16), lsl #16
cmp x8, x9
b.ne .Lbotch
-/* $OpenBSD: sigsetjmp.S,v 1.2 2017/03/22 07:31:35 guenther Exp $ */
+/* $OpenBSD: sigsetjmp.S,v 1.3 2022/12/24 10:49:19 kettenis Exp $ */
/*-
* Copyright (c) 2014 The FreeBSD Foundation
* All rights reserved.
ENTRY(siglongjmp)
/* Load the _setjmp magic */
- ldr x2, .Lmagic
+ movz x2, #(_JB_MAGIC__SETJMP & 0xffff)
+ movk x2, #(_JB_MAGIC__SETJMP >> 16), lsl #16
ldr x3, [x0]
/* Check the magic */
cmp x2, x3
b.eq _HIDDEN(_longjmp)
b _HIDDEN(longjmp)
-.Lmagic:
- .align 3
- .quad _JB_MAGIC__SETJMP
END(siglongjmp)