From 5018f4d308d23879a53052912dae9dcf00521a26 Mon Sep 17 00:00:00 2001 From: guenther Date: Wed, 12 Jan 2022 21:41:06 +0000 Subject: [PATCH] Lift the '#ifdef RCRT0' conditional out of boot*.h to crt0.c Prep for dropping #includes from archdep.h: pull in and declare _dl_exit() in boot*.h ok kettenis@ --- lib/csu/boot.h | 14 +++++++------- lib/csu/crt0.c | 4 ++-- lib/csu/hppa/boot_md.h | 14 +++++++------- lib/csu/mips64/boot_md.h | 14 +++++++------- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lib/csu/boot.h b/lib/csu/boot.h index e4d3bf34778..f9b6a641a1f 100644 --- a/lib/csu/boot.h +++ b/lib/csu/boot.h @@ -1,4 +1,4 @@ -/* $OpenBSD: boot.h,v 1.32 2021/11/16 02:46:46 guenther Exp $ */ +/* $OpenBSD: boot.h,v 1.33 2022/01/12 21:41:06 guenther Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -34,9 +34,13 @@ #define _DYN_LOADER -#include -#include #include +#include + +#include + +__dead +void _dl_exit(int); #include "archdep.h" @@ -47,8 +51,6 @@ #define REDIRECT_SYSCALL(x) typeof(x) x asm("_libc_"#x) __dso_hidden REDIRECT_SYSCALL(mprotect); -#ifdef RCRT0 - #if RELOC_TAG == DT_RELA typedef Elf_RelA RELOC_TYPE; #elif RELOC_TAG == DT_REL @@ -167,5 +169,3 @@ _dl_boot_bind(const long sp, long *dl_data, Elf_Dyn *dynp) } } } - -#endif /* RCRT0 */ diff --git a/lib/csu/crt0.c b/lib/csu/crt0.c index 9af919be4c1..e3615dfc16d 100644 --- a/lib/csu/crt0.c +++ b/lib/csu/crt0.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crt0.c,v 1.16 2021/11/14 00:45:38 guenther Exp $ */ +/* $OpenBSD: crt0.c,v 1.17 2022/01/12 21:41:06 guenther Exp $ */ /* * Copyright (c) 1995 Christopher G. Demetriou @@ -36,7 +36,7 @@ #include #include "md_init.h" -#ifdef MD_RCRT0_START +#ifdef RCRT0 # include BOOT_H #endif #include "extern.h" diff --git a/lib/csu/hppa/boot_md.h b/lib/csu/hppa/boot_md.h index 1c9fc4b91fd..ec8e19a6992 100644 --- a/lib/csu/hppa/boot_md.h +++ b/lib/csu/hppa/boot_md.h @@ -1,4 +1,4 @@ -/* $OpenBSD: boot_md.h,v 1.1 2021/11/14 00:45:38 guenther Exp $ */ +/* $OpenBSD: boot_md.h,v 1.2 2022/01/12 21:41:06 guenther Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -34,9 +34,13 @@ #define _DYN_LOADER -#include -#include #include +#include + +#include + +__dead +void _dl_exit(int); #include "archdep.h" @@ -47,8 +51,6 @@ #define REDIRECT_SYSCALL(x) typeof(x) x asm("_libc_"#x) __dso_hidden REDIRECT_SYSCALL(mprotect); -#ifdef RCRT0 - #if RELOC_TAG == DT_RELA typedef Elf_RelA RELOC_TYPE; #elif RELOC_TAG == DT_REL @@ -196,5 +198,3 @@ _dl_boot_bind(const long sp, long *dl_data, Elf_Dyn *dynp) } } } - -#endif /* RCRT0 */ diff --git a/lib/csu/mips64/boot_md.h b/lib/csu/mips64/boot_md.h index a8dec2e6dd7..7bf7d1d4784 100644 --- a/lib/csu/mips64/boot_md.h +++ b/lib/csu/mips64/boot_md.h @@ -1,4 +1,4 @@ -/* $OpenBSD: boot_md.h,v 1.1 2021/11/14 00:45:38 guenther Exp $ */ +/* $OpenBSD: boot_md.h,v 1.2 2022/01/12 21:41:06 guenther Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -34,9 +34,13 @@ #define _DYN_LOADER -#include -#include #include +#include + +#include + +__dead +void _dl_exit(int); #include "archdep.h" @@ -47,8 +51,6 @@ #define REDIRECT_SYSCALL(x) typeof(x) x asm("_libc_"#x) __dso_hidden REDIRECT_SYSCALL(mprotect); -#ifdef RCRT0 - #define DT_PROC(n) ((n) - DT_LOPROC) #if RELOC_TAG == DT_RELA @@ -181,5 +183,3 @@ _dl_boot_bind(const long sp, long *dl_data, Elf_Dyn *dynp) } } } - -#endif /* RCRT0 */ -- 2.20.1