summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2020-10-14 22:11:18 +0000
committerderaadt <deraadt@openbsd.org>2020-10-14 22:11:18 +0000
commit9c558c1181d4532fa3a04595bff127adc23ef057 (patch)
tree2ff5866cb8b865347db14d90a82ec1cd204527d4
parenttypo in error message (diff)
downloadwireguard-openbsd-9c558c1181d4532fa3a04595bff127adc23ef057.tar.xz
wireguard-openbsd-9c558c1181d4532fa3a04595bff127adc23ef057.zip
use symbolic SYS_exit instead of the value 1
ok kettenis
-rw-r--r--lib/csu/aarch64/md_init.h4
-rw-r--r--lib/csu/alpha/md_init.h4
-rw-r--r--lib/csu/amd64/md_init.h5
-rw-r--r--lib/csu/arm/md_init.h4
-rw-r--r--lib/csu/crt0.c5
-rw-r--r--lib/csu/hppa/md_init.h5
-rw-r--r--lib/csu/i386/md_init.h4
-rw-r--r--lib/csu/m88k/md_init.h4
-rw-r--r--lib/csu/mips64/md_init.h4
-rw-r--r--lib/csu/powerpc/md_init.h6
-rw-r--r--lib/csu/powerpc64/md_init.h6
-rw-r--r--lib/csu/sh/md_init.h4
12 files changed, 24 insertions, 31 deletions
diff --git a/lib/csu/aarch64/md_init.h b/lib/csu/aarch64/md_init.h
index 36f475682b4..aa015293f10 100644
--- a/lib/csu/aarch64/md_init.h
+++ b/lib/csu/aarch64/md_init.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.7 2020/02/18 12:19:11 kettenis Exp $ */
+/* $OpenBSD: md_init.h,v 1.8 2020/10/14 22:11:19 deraadt Exp $ */
/*-
* Copyright (c) 2001 Ross Harvey
@@ -111,7 +111,7 @@
" b ___start \n" \
" \n" \
"_dl_exit: \n" \
- " mov x8, #1 \n" \
+ " mov x8, #" STR(SYS_exit) " \n" \
" svc #0 \n" \
" dsb nsh \n" \
" isb \n" \
diff --git a/lib/csu/alpha/md_init.h b/lib/csu/alpha/md_init.h
index 715261459cb..ee71a702058 100644
--- a/lib/csu/alpha/md_init.h
+++ b/lib/csu/alpha/md_init.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.10 2018/11/22 21:37:29 guenther Exp $ */
+/* $OpenBSD: md_init.h,v 1.11 2020/10/14 22:11:19 deraadt Exp $ */
/*-
* Copyright (c) 2001 Ross Harvey
* All rights reserved.
@@ -98,7 +98,7 @@
".globl _dl_exit \n" \
".type _dl_exit@function \n" \
"_dl_exit: \n" \
- " lda $0, 1 \n" \
+ " lda $0, " STR(SYS_exit) " \n" \
" callsys \n" \
" ret")
diff --git a/lib/csu/amd64/md_init.h b/lib/csu/amd64/md_init.h
index 616dd4f618f..f136328eada 100644
--- a/lib/csu/amd64/md_init.h
+++ b/lib/csu/amd64/md_init.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.6 2016/03/20 02:32:39 guenther Exp $ */
+/* $OpenBSD: md_init.h,v 1.7 2020/10/14 22:11:19 deraadt Exp $ */
/*-
* Copyright (c) 2001 Ross Harvey
@@ -80,7 +80,6 @@
" jmp ___start \n" \
" .previous")
-
#define MD_RCRT0_START \
__asm( \
".text \n" \
@@ -114,7 +113,7 @@
" .type _dl_exit,@function \n" \
" .align 8 \n" \
"_dl_exit: \n" \
- " movl $(1), %eax \n" \
+ " movl $ " STR(SYS_exit) ", %eax \n" \
" syscall \n" \
" jb 1f \n" \
" ret \n" \
diff --git a/lib/csu/arm/md_init.h b/lib/csu/arm/md_init.h
index 283b5e3baf8..c8026dfde56 100644
--- a/lib/csu/arm/md_init.h
+++ b/lib/csu/arm/md_init.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.14 2020/03/13 09:31:26 deraadt Exp $ */
+/* $OpenBSD: md_init.h,v 1.15 2020/10/14 22:11:19 deraadt Exp $ */
/*-
* Copyright (c) 2001 Ross Harvey
@@ -155,7 +155,7 @@
" .long _DYNAMIC(GOTOFF) \n" \
" \n" \
"_dl_exit: \n" \
- " mov r12, #1 \n" \
+ " mov r12, #" STR(SYS_exit) " \n" \
" swi #0 \n" \
" dsb nsh \n" \
" isb \n" \
diff --git a/lib/csu/crt0.c b/lib/csu/crt0.c
index 2c113e73428..b27dfe5b2d5 100644
--- a/lib/csu/crt0.c
+++ b/lib/csu/crt0.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crt0.c,v 1.14 2019/05/10 13:29:21 guenther Exp $ */
+/* $OpenBSD: crt0.c,v 1.15 2020/10/14 22:11:18 deraadt Exp $ */
/*
* Copyright (c) 1995 Christopher G. Demetriou
@@ -31,6 +31,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <sys/syscall.h>
#include <stdlib.h>
#include <limits.h>
@@ -40,6 +41,8 @@
#endif
#include "extern.h"
+#define STR(x) __STRING(x) /* shorter macro name for MD_RCRT0_START */
+
/* some defaults */
#ifndef MD_START_ARGS
#define MD_START_ARGS \
diff --git a/lib/csu/hppa/md_init.h b/lib/csu/hppa/md_init.h
index 89934101b3f..a7a502e2428 100644
--- a/lib/csu/hppa/md_init.h
+++ b/lib/csu/hppa/md_init.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.13 2017/08/11 20:13:31 guenther Exp $ */
+/* $OpenBSD: md_init.h,v 1.14 2020/10/14 22:11:19 deraadt Exp $ */
/*
* Copyright (c) 2003 Dale Rahn. All rights reserved.
@@ -98,7 +98,6 @@
" .exit \n" \
" .procend")
-
#define MD_RCRT0_START \
__asm( \
".import $global$, data \n" \
@@ -148,7 +147,7 @@
" stw %rp, -24(%sp) \n" \
" ldil L%0xc0000000, %r1 \n" \
" ble 4(%sr7, %r1) \n" \
- " ldi 1, %t1 \n" \
+ " ldi " STR(SYS_exit) ", %t1 \n" \
" comb,<> %r0, %t1, 1f \n" \
" ldw -24(%sp), %rp \n" \
" bv %r0(%rp) \n" \
diff --git a/lib/csu/i386/md_init.h b/lib/csu/i386/md_init.h
index 54f03662df7..6f286ea8fc7 100644
--- a/lib/csu/i386/md_init.h
+++ b/lib/csu/i386/md_init.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.9 2017/08/11 20:13:31 guenther Exp $ */
+/* $OpenBSD: md_init.h,v 1.10 2020/10/14 22:11:19 deraadt Exp $ */
/*-
* Copyright (c) 2001 Ross Harvey
@@ -122,7 +122,7 @@
" .globl _dl_exit \n" \
" .type _dl_exit,@function \n" \
"_dl_exit: \n" \
- " mov $1, %eax \n" \
+ " mov $" STR(SYS_exit) ", %eax\n" \
" int $0x80 \n" \
" ret \n" \
" .previous")
diff --git a/lib/csu/m88k/md_init.h b/lib/csu/m88k/md_init.h
index 217a1a806db..5732c3c3caf 100644
--- a/lib/csu/m88k/md_init.h
+++ b/lib/csu/m88k/md_init.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.7 2018/10/06 23:30:25 aoyama Exp $ */
+/* $OpenBSD: md_init.h,v 1.8 2020/10/14 22:11:19 deraadt Exp $ */
/*
* Copyright (c) 2012 Miodrag Vallat.
@@ -100,7 +100,7 @@
" /* envp = argv + argc + 1 */ \n" \
\
"_dl_exit: \n" \
- " or %r13, %r0, 1 \n" \
+ " or %r13, %r0, " STR(SYS_exit) " \n" \
" tb0 0, %r0, 450 \n" \
" or %r0, %r0, %r0 \n" \
" .previous");
diff --git a/lib/csu/mips64/md_init.h b/lib/csu/mips64/md_init.h
index 990c94cce7e..7328965c8ea 100644
--- a/lib/csu/mips64/md_init.h
+++ b/lib/csu/mips64/md_init.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.17 2019/04/19 09:19:22 visa Exp $ */
+/* $OpenBSD: md_init.h,v 1.18 2020/10/14 22:11:19 deraadt Exp $ */
/*-
* Copyright (c) 2001 Ross Harvey
@@ -144,7 +144,7 @@
" .ent _dl_exit \n" \
" .type _dl_exit, @function \n" \
"_dl_exit: \n" \
- " li $v0, 1 \n" \
+ " li $v0, " STR(SYS_exit) " \n" \
" syscall \n" \
" j $ra \n" \
" .end _dl_exit \n" \
diff --git a/lib/csu/powerpc/md_init.h b/lib/csu/powerpc/md_init.h
index ff6f2083894..811262a9e24 100644
--- a/lib/csu/powerpc/md_init.h
+++ b/lib/csu/powerpc/md_init.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.9 2017/08/11 20:13:31 guenther Exp $ */
+/* $OpenBSD: md_init.h,v 1.10 2020/10/14 22:11:19 deraadt Exp $ */
/*-
* Copyright (c) 2001 Ross Harvey
@@ -61,10 +61,6 @@
" blr \n" \
" .previous")
-#include <sys/syscall.h> /* for SYS_mprotect */
-
-#define STR(x) __STRING(x)
-
#define MD_CRT0_START \
__asm( \
" .text \n" \
diff --git a/lib/csu/powerpc64/md_init.h b/lib/csu/powerpc64/md_init.h
index b99b8495dc2..3fa2ab118e6 100644
--- a/lib/csu/powerpc64/md_init.h
+++ b/lib/csu/powerpc64/md_init.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.2 2020/06/26 19:57:02 drahn Exp $ */
+/* $OpenBSD: md_init.h,v 1.3 2020/10/14 22:11:19 deraadt Exp $ */
/*
* Copyright (c) 2020 Dale Rahn <drahn@openbsd.org>
@@ -49,10 +49,6 @@
" blr \n" \
" .previous")
-#include <sys/syscall.h> /* for SYS_mprotect */
-
-#define STR(x) __STRING(x)
-
#define MD_CRT0_START \
__asm( \
" .text \n" \
diff --git a/lib/csu/sh/md_init.h b/lib/csu/sh/md_init.h
index 52700bf13e7..e98b6044d96 100644
--- a/lib/csu/sh/md_init.h
+++ b/lib/csu/sh/md_init.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.8 2017/08/11 20:13:31 guenther Exp $ */
+/* $OpenBSD: md_init.h,v 1.9 2020/10/14 22:11:19 deraadt Exp $ */
/* $NetBSD: dot_init.h,v 1.3 2005/12/24 22:02:10 perry Exp $ */
/*-
@@ -134,6 +134,6 @@ __asm(".section " #section "\n" \
" .globl _dl_exit \n" \
" .type _dl_exit,@function \n" \
"_dl_exit: \n" \
- " mov #1, r0 \n" \
+ " mov #" STR(SYS_exit) ", r0 \n" \
" .word 0xc380 /* trapa #0x80 */ \n" \
".previous")