diff options
author | Anton Lindqvist <anton@cvs.openbsd.org> | 2024-04-01 18:52:35 +0000 |
---|---|---|
committer | Anton Lindqvist <anton@cvs.openbsd.org> | 2024-04-01 18:52:35 +0000 |
commit | d3ac14394ab4ded31725dde53cbf0344b4414712 (patch) | |
tree | d8424861080badac333213b9009695ec009f706b /regress | |
parent | 38df3dbd5b2d795e96ef0eccde13ca2253c567e8 (diff) |
The regress/sys/arch/amd64/fpu/fenv.S utility issues "direct" syscalls
which does not go through libc. This is no longer possible due to
pinsyscalls(2). Borrow the PINSYSCALL asm macro from libc/arch/DEFS.h to
setup a .openbsd.syscalls section.
Diffstat (limited to 'regress')
-rw-r--r-- | regress/sys/arch/amd64/fpu/fenv.S | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/regress/sys/arch/amd64/fpu/fenv.S b/regress/sys/arch/amd64/fpu/fenv.S index 51ca8046b51..1ad78a1a51e 100644 --- a/regress/sys/arch/amd64/fpu/fenv.S +++ b/regress/sys/arch/amd64/fpu/fenv.S @@ -1,4 +1,4 @@ -/* $OpenBSD: fenv.S,v 1.1 2018/08/21 18:35:18 bluhm Exp $ */ +/* $OpenBSD: fenv.S,v 1.2 2024/04/01 18:52:34 anton Exp $ */ /* * Copyright (c) 2018 Alexander Bluhm <bluhm@openbsd.org> * @@ -17,6 +17,13 @@ #include <sys/syscall.h> +#define PINSYSCALL(sysno, label) \ + .pushsection .openbsd.syscalls,"",%progbits; \ + .p2align 2; \ + .long label; \ + .long sysno; \ + .popsection; + .section .note.openbsd.ident, "a" .p2align 2 .long 8 @@ -49,7 +56,11 @@ _start: mov $1, %rdi mov $env, %rsi mov $(env_end-env), %rdx +1: syscall + PINSYSCALL(SYS_write, 1b) mov $SYS_exit, %rax mov $0, %rdi +2: syscall + PINSYSCALL(SYS_exit, 2b) |