summaryrefslogtreecommitdiff
path: root/lib/csu/amd64/md_init.h
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/amd64/md_init.h
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/amd64/md_init.h')
-rw-r--r--lib/csu/amd64/md_init.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/csu/amd64/md_init.h b/lib/csu/amd64/md_init.h
index 948e7c928bb..fa9e812c87d 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.10 2023/04/25 04:10:21 deraadt Exp $ */
+/* $OpenBSD: md_init.h,v 1.11 2023/11/18 16:26:16 deraadt Exp $ */
/*-
* Copyright (c) 2001 Ross Harvey
@@ -107,12 +107,10 @@
" addq $8,%rsp \n" \
" jmp ___start \n" \
" \n" \
- " .global _dl_exit \n" \
- " .type _dl_exit,@function \n" \
+ " .global _csu_abort \n" \
+ " .type _csu_abort,@function \n" \
" .align 8 \n" \
- "_dl_exit: \n" \
+ "_csu_abort: \n" \
" endbr64 \n" \
- " movl $ " STR(SYS_exit) ", %eax \n" \
- " syscall \n" \
" int3 \n" \
" .previous")