From eebaec8bf69b2db1088ab7a84b8bc96a3d02473e Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sat, 18 Nov 2023 16:26:18 +0000 Subject: 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 --- libexec/ld.so/amd64/archdep.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libexec/ld.so/amd64') diff --git a/libexec/ld.so/amd64/archdep.h b/libexec/ld.so/amd64/archdep.h index f717f9c7ee8..415056dea41 100644 --- a/libexec/ld.so/amd64/archdep.h +++ b/libexec/ld.so/amd64/archdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: archdep.h,v 1.15 2022/01/17 01:35:36 guenther Exp $ */ +/* $OpenBSD: archdep.h,v 1.16 2023/11/18 16:26:17 deraadt Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -45,7 +45,7 @@ RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) } else if (ELF_R_TYPE(r->r_info) == R_X86_64_64) { *p = v + s->st_value + r->r_addend; } else { - _dl_exit(6); + _csu_abort(); } } -- cgit v1.2.3