summaryrefslogtreecommitdiff
path: root/lib/csu/sh
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2023-11-18 16:26:18 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2023-11-18 16:26:18 +0000
commiteebaec8bf69b2db1088ab7a84b8bc96a3d02473e (patch)
tree01c4cdb241357ce61e341e655dd01bce0c5d750d /lib/csu/sh
parent9039430940e09de13f4467d9fd1a12296a6746f4 (diff)
crt0 uses a helper function in a MD src/libexec/ld.so .h file (rather than
reproducing the relevant defines and code in a different place) to perform minor relocations. If things go very wrong, it would call _dl_exit() -- a locally defined crt0 function which is syscall exit(2). We don't need to call exit(2) for this obscure case which doesn't happen and provides no debugging information. An 'abort' is going to provide better information. So let's change the function name to _dso_abort() and make it a single illegal instruction. ok guenther
Diffstat (limited to 'lib/csu/sh')
-rw-r--r--lib/csu/sh/md_init.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/csu/sh/md_init.h b/lib/csu/sh/md_init.h
index f2940122c4a..b75014616d5 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.10 2020/10/15 16:30:23 deraadt Exp $ */
+/* $OpenBSD: md_init.h,v 1.11 2023/11/18 16:26:16 deraadt Exp $ */
/* $NetBSD: dot_init.h,v 1.3 2005/12/24 22:02:10 perry Exp $ */
/*-
@@ -131,10 +131,8 @@ __asm(".section " #section "\n" \
" .long _DYNAMIC - .L_offbase \n" \
\
" .align 2 \n" \
- " .globl _dl_exit \n" \
- " .type _dl_exit,@function \n" \
- "_dl_exit: \n" \
- " mov #" STR(SYS_exit) ", r0 \n" \
- " .word 0xc380 /* trapa #0x80 */ \n" \
+ " .globl _csu_abort \n" \
+ " .type _csu_abort,@function \n" \
+ "_csu_abort: \n" \
" sleep /* illegal */ \n" \
".previous")