crt0 uses a helper function in a MD src/libexec/ld.so .h file (rather than
authorderaadt <deraadt@openbsd.org>
Sat, 18 Nov 2023 16:26:15 +0000 (16:26 +0000)
committerderaadt <deraadt@openbsd.org>
Sat, 18 Nov 2023 16:26:15 +0000 (16:26 +0000)
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

29 files changed:
lib/csu/aarch64/md_init.h
lib/csu/alpha/md_init.h
lib/csu/amd64/md_init.h
lib/csu/arm/md_init.h
lib/csu/boot.h
lib/csu/hppa/boot_md.h
lib/csu/hppa/md_init.h
lib/csu/i386/md_init.h
lib/csu/m88k/md_init.h
lib/csu/mips64/boot_md.h
lib/csu/mips64/md_init.h
lib/csu/powerpc/md_init.h
lib/csu/powerpc64/md_init.h
lib/csu/riscv64/md_init.h
lib/csu/sh/md_init.h
lib/csu/sparc64/md_init.h
libexec/ld.so/aarch64/archdep.h
libexec/ld.so/alpha/archdep.h
libexec/ld.so/amd64/archdep.h
libexec/ld.so/arm/archdep.h
libexec/ld.so/hppa/archdep.h
libexec/ld.so/i386/archdep.h
libexec/ld.so/m88k/archdep.h
libexec/ld.so/mips64/archdep.h
libexec/ld.so/powerpc/archdep.h
libexec/ld.so/powerpc64/archdep.h
libexec/ld.so/riscv64/archdep.h
libexec/ld.so/sh/archdep.h
libexec/ld.so/sparc64/archdep.h

index 71356c6..c02b804 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.11 2023/03/31 18:46:24 kettenis Exp $ */
+/* $OpenBSD: md_init.h,v 1.12 2023/11/18 16:26:16 deraadt Exp $ */
 
 /*-
  * Copyright (c) 2001 Ross Harvey
        "                                       \n" \
        "       b       ___start                \n" \
        "                                       \n" \
-       "_dl_exit:                              \n" \
-       "       mov     x8, #" STR(SYS_exit) "  \n" \
-       "       svc     #0                      \n" \
-       "       dsb     nsh                     \n" \
-       "       isb                             \n" \
+       "_csu_abort:                            \n" \
        "       udf     #0                      \n" \
        ".previous");
index d503c75..76c80b2 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.12 2020/10/15 16:30:23 deraadt Exp $ */
+/* $OpenBSD: md_init.h,v 1.13 2023/11/18 16:26:16 deraadt Exp $ */
 /*-
  * Copyright (c) 2001 Ross Harvey
  * All rights reserved.
        "       mov     $9, $16                 \n" \
        "       mov     0, $17                  \n" \
        "       jsr     $26, ___start           \n" \
-       ".globl _dl_exit                        \n" \
-       ".type _dl_exit@function                \n" \
-       "_dl_exit:                              \n" \
-       "       lda     $0, " STR(SYS_exit) "   \n" \
-       "       callsys                         \n" \
+       ".globl _csu_abort                      \n" \
+       ".type _csu_abort@function              \n" \
+       "_csu_abort:                            \n" \
        "       halt                            ")
 
 #define        MD_START_ARGS           char **sp, void (*cleanup)(void)
index 948e7c9..fa9e812 100644 (file)
@@ -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
        "       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")
index 3a9b581..63bfc8b 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.17 2020/10/19 17:57:40 naddy Exp $ */
+/* $OpenBSD: md_init.h,v 1.18 2023/11/18 16:26:16 deraadt Exp $ */
 
 /*-
  * Copyright (c) 2001 Ross Harvey
        ".L__DYNAMIC:                           \n" \
        "       .long   _DYNAMIC(GOTOFF)        \n" \
        "                                       \n" \
-       "_dl_exit:                              \n" \
-       "       mov     r12, #" STR(SYS_exit) " \n" \
-       "       swi     #0                      \n" \
-       "       dsb     nsh                     \n" \
-       "       isb                             \n" \
+       "_csu_abort:                            \n" \
        "       udf     #0                      \n" \
        ".previous");
index 72cbfee..da6d424 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: boot.h,v 1.34 2022/10/21 18:14:09 deraadt Exp $ */
+/*     $OpenBSD: boot.h,v 1.35 2023/11/18 16:26:15 deraadt Exp $ */
 
 /*
  * Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -40,7 +40,7 @@
 #include <machine/reloc.h>
 
 __dead
-void _dl_exit(int);
+void _csu_abort(void);
 
 #include "archdep.h"
 
index a770f7a..0a8f406 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: boot_md.h,v 1.4 2022/10/27 19:40:21 deraadt Exp $ */
+/*     $OpenBSD: boot_md.h,v 1.5 2023/11/18 16:26:16 deraadt Exp $ */
 
 /*
  * Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -40,7 +40,7 @@
 #include <machine/reloc.h>
 
 __dead
-void _dl_exit(int);
+void _csu_abort(void);
 
 #include "archdep.h"
 
index 5abe6da..7b0813e 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.15 2020/10/15 16:30:23 deraadt Exp $ */
+/* $OpenBSD: md_init.h,v 1.16 2023/11/18 16:26:16 deraadt Exp $ */
 
 /*
  * Copyright (c) 2003 Dale Rahn. All rights reserved.
        "       copy    %dp, %r19                               \n" \
        "       .exit                                           \n" \
        "       .procend                                        \n" \
-       "       .export _dl_exit, entry                         \n" \
-       "       .type   _dl_exit,@function                      \n" \
-       "       .label _dl_exit                                 \n" \
+       "       .export _csu_abort, entry                       \n" \
+       "       .type   _csu_abort,@function                    \n" \
+       "       .label _csu_abort                               \n" \
        "       .proc                                           \n" \
        "       .callinfo frame=0, calls                        \n" \
        "       .entry                                          \n" \
-       "_dl_exit:                                              \n" \
-       "       stw     %rp, -24(%sp)                           \n" \
-       "       ldil    L%0xc0000000, %r1                       \n" \
-       "       ble     4(%sr7, %r1)                            \n" \
-       "       ldi     " STR(SYS_exit) ", %t1                  \n" \
+       "_csu_abort:                                            \n" \
        "       break 0,0                                       \n" \
        "       .exit                                           \n" \
        "       .procend")
index efd601d..f401328 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.12 2023/04/25 04:06:06 deraadt Exp $ */
+/* $OpenBSD: md_init.h,v 1.13 2023/11/18 16:26:16 deraadt Exp $ */
 
 /*-
  * Copyright (c) 2001 Ross Harvey
        "       call    ___start        # ___start(argc,argv,envp,0) \n" \
        "                                       \n" \
        "       .align  4                       \n" \
-       "       .globl  _dl_exit                \n" \
-       "       .type   _dl_exit,@function      \n" \
-       "_dl_exit:                              \n" \
-       "       mov     $" STR(SYS_exit) ", %eax\n" \
-       "       int     $0x80                   \n" \
+       "       .globl  _csu_abort              \n" \
+       "       .type   _csu_abort,@function    \n" \
+       "_csu_abort:                            \n" \
        "       int3                            \n" \
        "       .previous")
index f73ed3e..6f37b9d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: md_init.h,v 1.9 2020/10/15 16:30:23 deraadt Exp $     */
+/*     $OpenBSD: md_init.h,v 1.10 2023/11/18 16:26:16 deraadt Exp $    */
 
 /*
  * Copyright (c) 2012 Miodrag Vallat.
@@ -99,9 +99,6 @@
        "        addu   %r4, %r4, 4                     \n" \
        "        /* envp = argv + argc + 1 */           \n" \
        \
-       "_dl_exit:                                      \n" \
-       "       or      %r13, %r0, " STR(SYS_exit) "    \n" \
-       "       tb0     0, %r0, 450                     \n" \
-       "       or      %r0, %r0, %r0                   \n" \
+       "_csu_abort:                                    \n" \
        "       tb0     0, %r0, 130 /* breakpoint */    \n" \
        "       .previous");
index 09fb17f..8c2f6ec 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: boot_md.h,v 1.3 2022/10/27 19:40:23 deraadt Exp $ */
+/*     $OpenBSD: boot_md.h,v 1.4 2023/11/18 16:26:16 deraadt Exp $ */
 
 /*
  * Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -40,7 +40,7 @@
 #include <machine/reloc.h>
 
 __dead
-void _dl_exit(int);
+void _csu_abort(int);
 
 #include "archdep.h"
 
index ad4e70a..0f5045d 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.20 2020/10/20 15:26:59 visa Exp $ */
+/* $OpenBSD: md_init.h,v 1.21 2023/11/18 16:26:16 deraadt Exp $ */
 
 /*-
  * Copyright (c) 2001 Ross Harvey
        "       dla     $t9, ___start           \n" \
        "       jr      $t9                     \n" \
        "       .end    __start                 \n" \
-       "       .globl  _dl_exit                \n" \
-       "       .ent    _dl_exit                \n" \
-       "       .type   _dl_exit, @function     \n" \
-       "_dl_exit:                              \n" \
-       "       li      $v0, " STR(SYS_exit) "  \n" \
-       "       syscall                         \n" \
-       "       teq     $zero, $zero, 0x52      \n" \
-       "       .end    _dl_exit                \n" \
+       "       .globl  _csu_abort              \n" \
+       "       .ent    _csu_abort              \n" \
+       "       .type   _csu_abort, @function   \n" \
+       "_csu_abort:                            \n" \
+       "       teq     zero, zero, 0x52        \n" \
+       "       .end    _csu_abort              \n" \
        "       .previous")
 
 struct kframe {
index fa4a3f5..7c206e6 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.11 2020/10/15 16:30:23 deraadt Exp $ */
+/* $OpenBSD: md_init.h,v 1.12 2023/11/18 16:26:16 deraadt Exp $ */
 
 /*-
  * Copyright (c) 2001 Ross Harvey
@@ -119,10 +119,8 @@ __asm(                                                                     \
 "                                                                      \n" \
 "      .text                                                           \n" \
 "      .align 2                                                        \n" \
-"      .globl  _dl_exit                                                \n" \
-"      .type   _dl_exit, @function                                     \n" \
-"_dl_exit:                                                             \n" \
-"      li      %r0, " STR(SYS_exit) "                                  \n" \
-"      sc                                                              \n" \
+"      .globl  _csu_abort                                              \n" \
+"      .type   _csu_abort, @function                                   \n" \
+"_csu_abort:                                                           \n" \
 "      .long 0 # illegal                                               \n" \
 )
index e2054bd..110cc5b 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.4 2020/10/15 16:30:23 deraadt Exp $ */
+/* $OpenBSD: md_init.h,v 1.5 2023/11/18 16:26:16 deraadt Exp $ */
 
 /*
  * Copyright (c) 2020 Dale Rahn <drahn@openbsd.org>
@@ -111,10 +111,8 @@ __asm(                                                                     \
 "      li %r6, 0                                                       \n" \
 "      bl ___start                                                     \n" \
 "                                                                      \n" \
-"      .globl  _dl_exit                                                \n" \
-"      .type   _dl_exit, @function                                     \n" \
-"_dl_exit:                                                             \n" \
-"      li      %r0, " STR(SYS_exit) "                                  \n" \
-"      sc                                                              \n" \
+"      .globl  _csu_abort                                              \n" \
+"      .type   _csu_abort, @function                                   \n" \
+"_csu_abort:                                                           \n" \
 "      .long 0 # illegal                                               \n" \
 )
index 1f45438..62bf463 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.3 2021/07/22 18:16:13 kettenis Exp $ */
+/* $OpenBSD: md_init.h,v 1.4 2023/11/18 16:26:16 deraadt Exp $ */
 /*
  * Copyright (c) 2020 Dale Rahn <drahn@openbsd.org>
  *
        "       j       ___start                                        \n" \
        "       .size   _start, .-_start                                \n" \
        "       .size   __start, .-__start                              \n" \
-       "_dl_exit:                                                      \n" \
-       "       li      t0, " STR(SYS_exit) "                           \n" \
-       "       ecall                                                   \n" \
+       "_csu_abort:                                                    \n" \
        "       unimp                                                   \n" \
        ".previous");
index f294012..b750146 100644 (file)
@@ -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")
index 09f0f0c..7857bac 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: md_init.h,v 1.9 2020/10/15 16:30:23 deraadt Exp $ */
+/* $OpenBSD: md_init.h,v 1.10 2023/11/18 16:26:16 deraadt Exp $ */
 
 /*-
  * Copyright (c) 2001 Ross Harvey
        "       ba,pt   %icc, ___start          \n" \
        "        clr    %o1                     \n" \
        "                                       \n" \
-       "       .global _dl_exit                \n" \
-       "_dl_exit:                              \n" \
-       "       mov     " STR(SYS_exit) ", %g1  \n" \
-       "       t       0                       \n" \
+       "       .global _csu_abort              \n" \
+       "_csu_abort:                            \n" \
        "       unimp                           \n" \
        "       .previous")
 
index 8e6fa7d..8041148 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: archdep.h,v 1.8 2022/01/17 01:35:36 guenther Exp $ */
+/*     $OpenBSD: archdep.h,v 1.9 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_AARCH64_ABS64) {
                *p = v + s->st_value + r->r_addend;
        } else {
-               _dl_exit(6);
+               _csu_abort();
        }
 }
 
index f952fea..4590afc 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: archdep.h,v 1.25 2022/01/31 05:44:13 guenther Exp $ */
+/*     $OpenBSD: archdep.h,v 1.26 2023/11/18 16:26:17 deraadt Exp $ */
 
 /*
  * Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -50,7 +50,7 @@ RELOC_DYN(const Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
        } else if (ELF_R_TYPE(r->r_info) == RELOC_GLOB_DAT) {
                *p = v + s->st_value + r->r_addend;
        } else {
-               _dl_exit(6);
+               _csu_abort();
        }
 }
 
index f717f9c..415056d 100644 (file)
@@ -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();
        }
 }
 
index c6adff4..7d23f0a 100644 (file)
@@ -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_Rel *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
        } else if (ELF_R_TYPE(r->r_info) == R_ARM_ABS32) {
                *p += v + s->st_value;
        } else {
-               _dl_exit(6);
+               _csu_abort();
        }
 }
 
index 6aa0587..5267680 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: archdep.h,v 1.18 2022/01/31 05:43:22 guenther Exp $   */
+/*     $OpenBSD: archdep.h,v 1.19 2023/11/18 16:26:17 deraadt Exp $    */
 
 /*
  * Copyright (c) 2004 Michael Shalayeff
@@ -49,7 +49,7 @@ RELOC_JMPREL(const Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v,
                p[0] = v + s->st_value + r->r_addend;
                p[1] = pltgot;
        } else {
-               _dl_exit(5);
+               _csu_abort();
        }
 }
 
@@ -64,7 +64,7 @@ RELOC_DYN(const Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
        } else if (ELF_R_TYPE(r->r_info) == RELOC_PLABEL32) {
                *p = v + s->st_value + r->r_addend;
        } else {
-               _dl_exit(6);
+               _csu_abort();
        }
 }
 
index 65dcaab..e5a9c77 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: archdep.h,v 1.23 2022/01/17 01:35:36 guenther Exp $ */
+/*     $OpenBSD: archdep.h,v 1.24 2023/11/18 16:26:17 deraadt Exp $ */
 
 /*
  * Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -46,7 +46,7 @@ RELOC_DYN(const Elf_Rel *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
        } else if (ELF_R_TYPE(r->r_info) == RELOC_32) {
                *p += v + s->st_value;
        } else {
-               _dl_exit(6);
+               _csu_abort();
        }
 }
 
index fa16862..c22bbd2 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: archdep.h,v 1.10 2022/01/16 02:14:27 guenther Exp $   */
+/*     $OpenBSD: archdep.h,v 1.11 2023/11/18 16:26:17 deraadt Exp $    */
 
 /*
  * Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -43,7 +43,7 @@ RELOC_DYN(const Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
        } else if (ELF_R_TYPE(r->r_info) == RELOC_32) {
                *p = v + s->st_value + r->r_addend;
        } else if (ELF_R_TYPE(r->r_info) != RELOC_NONE) {
-               _dl_exit(ELF_R_TYPE(r->r_info) + 100);
+               _csu_abort();
        }
 }
 
index 386765e..957527b 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: archdep.h,v 1.17 2022/01/17 19:45:34 guenther Exp $ */
+/*     $OpenBSD: archdep.h,v 1.18 2023/11/18 16:26:17 deraadt Exp $ */
 
 /*
  * Copyright (c) 1998-2002 Opsycon AB, Sweden.
@@ -45,7 +45,7 @@ do {                                                                  \
                else                                                    \
                        *adrp += val;                                   \
        } else if (ELF_R_TYPE(relp->r_info) != R_MIPS_NONE) {           \
-               _dl_exit(ELF_R_TYPE(relp->r_info)+100);                 \
+               _csu_abort();                                           \
        }                                                               \
 } while (0)
 
@@ -76,7 +76,7 @@ do {                                                                  \
                if (sp->st_shndx == SHN_UNDEF ||                        \
                    sp->st_shndx == SHN_COMMON) {                       \
                        if (ELF_ST_BIND(sp->st_info) != STB_WEAK)       \
-                               _dl_exit(7);                            \
+                               _csu_abort();                           \
                } else if (ELF_ST_TYPE(sp->st_info) == STT_FUNC) {      \
                        *gotp += __loff;                                \
                } else {                                                \
index 678672b..5f26d72 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: archdep.h,v 1.25 2022/01/17 01:35:36 guenther Exp $ */
+/*     $OpenBSD: archdep.h,v 1.26 2023/11/18 16:26:17 deraadt Exp $ */
 
 /*
  * Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -58,7 +58,7 @@ RELOC_DYN(const Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
                if (((val & 0xfe000000) != 0) &&
                    ((val & 0xfe000000) != 0xfe000000)) {
                        /* invalid offset */
-                       _dl_exit(20);
+                       _csu_abort();
                }
                val &= ~0xfc000000;
                val |=  0x48000000;
@@ -67,7 +67,7 @@ RELOC_DYN(const Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
        } else if (ELF_R_TYPE((r)->r_info) == RELOC_GLOB_DAT) {
                *p = v + s->st_value + r->r_addend;
        } else {
-               _dl_exit(6);
+               _csu_abort();
        }
 }
 
index b27d9a7..93cff9e 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: archdep.h,v 1.4 2022/01/16 02:16:40 guenther Exp $ */
+/*     $OpenBSD: archdep.h,v 1.5 2023/11/18 16:26:17 deraadt Exp $ */
 
 /*
  * Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -59,7 +59,7 @@ RELOC_DYN(const Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
                if (((val & 0xfe000000) != 0) &&
                    ((val & 0xfe000000) != 0xfe000000)) {
                        /* invalid offset */
-                       _dl_exit(20);
+                       _csu_abort();
                }
                val &= ~0xfc000000;
                val |=  0x48000000;
@@ -68,7 +68,7 @@ RELOC_DYN(const Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
        } else if (ELF_R_TYPE((r)->r_info) == R_PPC64_GLOB_DAT) {
                *p = v + s->st_value + r->r_addend;
        } else {
-               _dl_exit(6);
+               _csu_abort();
        }
 }
 
index 5e090c7..8c85c83 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: archdep.h,v 1.4 2022/01/16 02:17:05 guenther Exp $ */
+/*     $OpenBSD: archdep.h,v 1.5 2023/11/18 16:26:17 deraadt Exp $ */
 
 /*
  * Copyright (c) 2021 Dale Rahn <drahn@openbsd.org>
@@ -44,7 +44,7 @@ RELOC_DYN(const Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
        } else if (ELF_R_TYPE(r->r_info) == R_RISCV_64) {
                *p = v + s->st_value + r->r_addend;
        } else {
-               _dl_exit(6);
+               _csu_abort();
        }
 }
 
index d56c32b..0a3c6c4 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: archdep.h,v 1.14 2022/01/17 01:35:36 guenther Exp $ */
+/*     $OpenBSD: archdep.h,v 1.15 2023/11/18 16:26:17 deraadt Exp $ */
 
 /*
  * Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -43,7 +43,7 @@ RELOC_DYN(const Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
        } else if (ELF_R_TYPE(r->r_info) == R_SH_DIR32) {
                *p = s->st_value + v + r->r_addend;
        } else {
-               _dl_exit(6);
+               _csu_abort();
        }
 }
 
index 3a7b2d5..e4c57b7 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: archdep.h,v 1.28 2022/01/17 01:35:36 guenther Exp $ */
+/*     $OpenBSD: archdep.h,v 1.29 2023/11/18 16:26:17 deraadt Exp $ */
 
 /*
  * Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -41,7 +41,7 @@ RELOC_DYN(const Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
        if (ELF_R_TYPE(r->r_info) == RELOC_RELATIVE) {
                *p = v + r->r_addend;
        } else {
-               _dl_exit(6);
+               _csu_abort();
        }
 }