diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2021-11-14 22:07:40 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2021-11-14 22:07:40 +0000 |
commit | 9a3f11ecc7e6812c85aa9b046ec0fce3df789558 (patch) | |
tree | 5e0bdc3259789a345a692d5ad13c524cd3828d46 /libexec/ld.so | |
parent | f4cc19d0f4beb78c00e533a8cc0ee20456bb1d88 (diff) |
Delete all the no-op RELOC_GOT() macros and their uses.
Annotate RELOC_DYN() on non-hppa as only used in lib/csu.
Delete some inconsistent comments, adjust whitespace, and reorder
mips64's archdep.h so that the ld.so/*/archdep.h files look
(almost) the same.
ok visa@ kettenis@
Diffstat (limited to 'libexec/ld.so')
-rw-r--r-- | libexec/ld.so/aarch64/archdep.h | 8 | ||||
-rw-r--r-- | libexec/ld.so/alpha/archdep.h | 9 | ||||
-rw-r--r-- | libexec/ld.so/amd64/archdep.h | 8 | ||||
-rw-r--r-- | libexec/ld.so/arm/archdep.h | 12 | ||||
-rw-r--r-- | libexec/ld.so/hppa/archdep.h | 8 | ||||
-rw-r--r-- | libexec/ld.so/hppa/boot_md.c | 4 | ||||
-rw-r--r-- | libexec/ld.so/i386/archdep.h | 8 | ||||
-rw-r--r-- | libexec/ld.so/m88k/archdep.h | 12 | ||||
-rw-r--r-- | libexec/ld.so/mips64/archdep.h | 9 | ||||
-rw-r--r-- | libexec/ld.so/powerpc/archdep.h | 12 | ||||
-rw-r--r-- | libexec/ld.so/powerpc64/archdep.h | 12 | ||||
-rw-r--r-- | libexec/ld.so/riscv64/archdep.h | 9 | ||||
-rw-r--r-- | libexec/ld.so/sh/archdep.h | 12 | ||||
-rw-r--r-- | libexec/ld.so/sparc64/archdep.h | 8 |
14 files changed, 43 insertions, 88 deletions
diff --git a/libexec/ld.so/aarch64/archdep.h b/libexec/ld.so/aarch64/archdep.h index a34e6d6d18f..692b0da2a3f 100644 --- a/libexec/ld.so/aarch64/archdep.h +++ b/libexec/ld.so/aarch64/archdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: archdep.h,v 1.6 2019/10/23 19:55:08 guenther Exp $ */ +/* $OpenBSD: archdep.h,v 1.7 2021/11/14 22:07:38 guenther Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -30,8 +30,7 @@ #define _AARCH64_ARCHDEP_H_ #define RELOC_TAG DT_RELA - -#define MACHID EM_AARCH64 /* ELF e_machine ID value checked */ +#define MACHID EM_AARCH64 /* ELF e_machine ID value checked */ #include <elf.h> #include <machine/reloc.h> @@ -39,6 +38,7 @@ #include "util.h" +/* Only used in lib/csu/boot.h */ static inline void RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) { @@ -53,6 +53,4 @@ RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) } } -#define RELOC_GOT(obj, offs) - #endif /* _AARCH64_ARCHDEP_H_ */ diff --git a/libexec/ld.so/alpha/archdep.h b/libexec/ld.so/alpha/archdep.h index 74c7318af73..24cc66535c5 100644 --- a/libexec/ld.so/alpha/archdep.h +++ b/libexec/ld.so/alpha/archdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: archdep.h,v 1.23 2019/10/23 19:55:08 guenther Exp $ */ +/* $OpenBSD: archdep.h,v 1.24 2021/11/14 22:07:38 guenther Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -30,14 +30,15 @@ #define _ALPHA_ARCHDEP_H_ #define RELOC_TAG DT_RELA - -#define MACHID EM_ALPHA_EXP /* ELF e_machine ID value checked */ +#define MACHID EM_ALPHA_EXP /* ELF e_machine ID value checked */ #include <elf.h> #include <machine/reloc.h> #include "syscall.h" #include "util.h" + +/* Only used in lib/csu/boot.h */ static inline void RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) { @@ -57,6 +58,4 @@ RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) } } -#define RELOC_GOT(obj, offs) - #endif /* _ALPHA_ARCHDEP_H_ */ diff --git a/libexec/ld.so/amd64/archdep.h b/libexec/ld.so/amd64/archdep.h index 17713fecf26..c3bf017be7b 100644 --- a/libexec/ld.so/amd64/archdep.h +++ b/libexec/ld.so/amd64/archdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: archdep.h,v 1.13 2019/10/23 19:55:09 guenther Exp $ */ +/* $OpenBSD: archdep.h,v 1.14 2021/11/14 22:07:38 guenther Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -30,8 +30,7 @@ #define _X86_64_ARCHDEP_H_ #define RELOC_TAG DT_RELA - -#define MACHID EM_AMD64 /* ELF e_machine ID value checked */ +#define MACHID EM_AMD64 /* ELF e_machine ID value checked */ #include <elf.h> #include <machine/reloc.h> @@ -39,6 +38,7 @@ #include "util.h" +/* Only used in lib/csu/boot.h */ static inline void RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) { @@ -53,6 +53,4 @@ RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) } } -#define RELOC_GOT(obj, offs) - #endif /* _X86_64_ARCHDEP_H_ */ diff --git a/libexec/ld.so/arm/archdep.h b/libexec/ld.so/arm/archdep.h index 6a87c902cfd..198bc7f8661 100644 --- a/libexec/ld.so/arm/archdep.h +++ b/libexec/ld.so/arm/archdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: archdep.h,v 1.13 2017/10/27 16:47:08 mpi Exp $ */ +/* $OpenBSD: archdep.h,v 1.14 2021/11/14 22:07:38 guenther Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -30,19 +30,15 @@ #define _ARM_ARCHDEP_H_ #define RELOC_TAG DT_REL - -#define MACHID EM_ARM /* ELF e_machine ID value checked */ +#define MACHID EM_ARM /* ELF e_machine ID value checked */ #include <elf.h> #include <machine/reloc.h> #include "syscall.h" #include "util.h" -/* - * The following functions are declared inline so they can - * be used before bootstrap linking has been finished. - */ +/* Only used in lib/csu/boot.h */ static inline void RELOC_DYN(Elf_Rel *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) { @@ -57,6 +53,4 @@ RELOC_DYN(Elf_Rel *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) } } -#define RELOC_GOT(obj, offs) - #endif /* _ARM_ARCHDEP_H_ */ diff --git a/libexec/ld.so/hppa/archdep.h b/libexec/ld.so/hppa/archdep.h index f6dc5df3117..d9a64d8c909 100644 --- a/libexec/ld.so/hppa/archdep.h +++ b/libexec/ld.so/hppa/archdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: archdep.h,v 1.16 2017/10/27 16:47:08 mpi Exp $ */ +/* $OpenBSD: archdep.h,v 1.17 2021/11/14 22:07:38 guenther Exp $ */ /* * Copyright (c) 2004 Michael Shalayeff @@ -31,9 +31,7 @@ #define _HPPA_ARCHDEP_H_ #define RELOC_TAG DT_RELA -#define HAVE_JMPREL 1 - -#define MACHID EM_PARISC /* ELF e_machine ID value checked */ +#define MACHID EM_PARISC /* ELF e_machine ID value checked */ #include <elf.h> #include <machine/reloc.h> @@ -68,8 +66,6 @@ RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) } } -#define RELOC_GOT(obj, offs) - void _hppa_dl_dtors(void); Elf_Addr _dl_md_plabel(Elf_Addr, Elf_Addr *); diff --git a/libexec/ld.so/hppa/boot_md.c b/libexec/ld.so/hppa/boot_md.c index c0ba63ae03b..20cafc6c84b 100644 --- a/libexec/ld.so/hppa/boot_md.c +++ b/libexec/ld.so/hppa/boot_md.c @@ -1,4 +1,4 @@ -/* $OpenBSD: boot_md.c,v 1.4 2019/11/28 16:57:17 guenther Exp $ */ +/* $OpenBSD: boot_md.c,v 1.5 2021/11/14 22:07:38 guenther Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -167,6 +167,4 @@ _dl_boot_bind(const long sp, long *dl_data, Elf_Dyn *dynp) RELOC_DYN(rp, sp, ra, loff); rp++; } - - RELOC_GOT(&dynld, loff); } diff --git a/libexec/ld.so/i386/archdep.h b/libexec/ld.so/i386/archdep.h index 066a675c2a2..d0462ca46ad 100644 --- a/libexec/ld.so/i386/archdep.h +++ b/libexec/ld.so/i386/archdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: archdep.h,v 1.21 2019/10/23 19:55:09 guenther Exp $ */ +/* $OpenBSD: archdep.h,v 1.22 2021/11/14 22:07:38 guenther Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -30,8 +30,7 @@ #define _I386_ARCHDEP_H_ #define RELOC_TAG DT_REL - -#define MACHID EM_386 /* ELF e_machine ID value checked */ +#define MACHID EM_386 /* ELF e_machine ID value checked */ #include <elf.h> #include <machine/reloc.h> @@ -39,6 +38,7 @@ #include "util.h" +/* Only used in lib/csu/boot.h */ static inline void RELOC_DYN(Elf_Rel *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) { @@ -54,6 +54,4 @@ RELOC_DYN(Elf_Rel *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) } } -#define RELOC_GOT(obj, offs) - #endif /* _I386_ARCHDEP_H_ */ diff --git a/libexec/ld.so/m88k/archdep.h b/libexec/ld.so/m88k/archdep.h index 2a96593df2b..a7c161fb7a7 100644 --- a/libexec/ld.so/m88k/archdep.h +++ b/libexec/ld.so/m88k/archdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: archdep.h,v 1.8 2019/10/23 19:55:09 guenther Exp $ */ +/* $OpenBSD: archdep.h,v 1.9 2021/11/14 22:07:38 guenther Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -30,19 +30,15 @@ #define _M88K_ARCHDEP_H_ #define RELOC_TAG DT_RELA - -#define MACHID EM_88K /* ELF e_machine ID value checked */ +#define MACHID EM_88K /* ELF e_machine ID value checked */ #include <elf.h> #include <machine/reloc.h> #include "syscall.h" #include "util.h" -/* - * The following functions are declared inline so they can - * be used before bootstrap linking has been finished. - */ +/* Only used in lib/csu/boot.h */ static inline void RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) { @@ -55,6 +51,4 @@ RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) } } -#define RELOC_GOT(obj, offs) do { } while (0) - #endif /* _M88K_ARCHDEP_H_ */ diff --git a/libexec/ld.so/mips64/archdep.h b/libexec/ld.so/mips64/archdep.h index 6e612252285..ad75461a426 100644 --- a/libexec/ld.so/mips64/archdep.h +++ b/libexec/ld.so/mips64/archdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: archdep.h,v 1.15 2019/10/23 19:55:09 guenther Exp $ */ +/* $OpenBSD: archdep.h,v 1.16 2021/11/14 22:07:39 guenther Exp $ */ /* * Copyright (c) 1998-2002 Opsycon AB, Sweden. @@ -29,15 +29,16 @@ #ifndef _MIPS_ARCHDEP_H_ #define _MIPS_ARCHDEP_H_ +#define RELOC_TAG DT_REL +#define MACHID EM_MIPS /* ELF e_machine ID value checked */ + #include <elf.h> #include <machine/reloc.h> #include "syscall.h" #include "util.h" -#define RELOC_TAG DT_REL -#define MACHID EM_MIPS /* ELF e_machine ID value checked */ - +/* Only used in lib/csu/mips64/boot_md.h */ #define RELOC_DYN(relp, symp, adrp, val) \ do { \ if (ELF_R_TYPE(relp->r_info) == R_MIPS_REL32_64) { \ diff --git a/libexec/ld.so/powerpc/archdep.h b/libexec/ld.so/powerpc/archdep.h index 02898ceae0f..5baae022038 100644 --- a/libexec/ld.so/powerpc/archdep.h +++ b/libexec/ld.so/powerpc/archdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: archdep.h,v 1.23 2019/10/23 19:55:09 guenther Exp $ */ +/* $OpenBSD: archdep.h,v 1.24 2021/11/14 22:07:39 guenther Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -30,18 +30,13 @@ #define _POWERPC_ARCHDEP_H_ #define RELOC_TAG DT_RELA - -#define MACHID EM_PPC /* ELF e_machine ID value checked */ +#define MACHID EM_PPC /* ELF e_machine ID value checked */ #include <elf.h> #include <machine/reloc.h> #include "syscall.h" #include "util.h" -/* - * The following functions are declared inline so they can - * be used before bootstrap linking has been finished. - */ static inline void _dl_dcbf(Elf_Addr *addr) @@ -54,6 +49,7 @@ _dl_dcbf(Elf_Addr *addr) : : "r" (addr) : "0"); } +/* Only used in lib/csu/boot.h */ static inline void RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) { @@ -78,6 +74,4 @@ RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) } } -#define RELOC_GOT(obj, offs) - #endif /* _POWERPC_ARCHDEP_H_ */ diff --git a/libexec/ld.so/powerpc64/archdep.h b/libexec/ld.so/powerpc64/archdep.h index 0f38a2402ac..b3427e454da 100644 --- a/libexec/ld.so/powerpc64/archdep.h +++ b/libexec/ld.so/powerpc64/archdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: archdep.h,v 1.2 2020/07/18 16:41:43 kettenis Exp $ */ +/* $OpenBSD: archdep.h,v 1.3 2021/11/14 22:07:39 guenther Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -30,18 +30,13 @@ #define _POWERPC_ARCHDEP_H_ #define RELOC_TAG DT_RELA - -#define MACHID EM_PPC64 /* ELF e_machine ID value checked */ +#define MACHID EM_PPC64 /* ELF e_machine ID value checked */ #include <elf.h> #include <machine/reloc.h> #include "syscall.h" #include "util.h" -/* - * The following functions are declared inline so they can - * be used before bootstrap linking has been finished. - */ static inline void _dl_dcbf(Elf_Addr *addr) @@ -54,6 +49,7 @@ _dl_dcbf(Elf_Addr *addr) : : "r" (addr) : "0"); } +/* Only used in lib/csu/boot.h */ static inline void RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) { @@ -78,6 +74,4 @@ RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) } } -#define RELOC_GOT(obj, offs) - #endif /* _POWERPC_ARCHDEP_H_ */ diff --git a/libexec/ld.so/riscv64/archdep.h b/libexec/ld.so/riscv64/archdep.h index 604a76881d6..ec29775dc74 100644 --- a/libexec/ld.so/riscv64/archdep.h +++ b/libexec/ld.so/riscv64/archdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: archdep.h,v 1.2 2021/11/09 21:22:29 guenther Exp $ */ +/* $OpenBSD: archdep.h,v 1.3 2021/11/14 22:07:39 guenther Exp $ */ /* * Copyright (c) 2021 Dale Rahn <drahn@openbsd.org> @@ -31,14 +31,15 @@ #define _AARCH64_ARCHDEP_H_ #define RELOC_TAG DT_RELA - -#define MACHID EM_RISCV /* ELF e_machine ID value checked */ +#define MACHID EM_RISCV /* ELF e_machine ID value checked */ #include <elf.h> #include <machine/reloc.h> #include "syscall.h" #include "util.h" + +/* Only used in lib/csu/boot.h */ static inline void RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) { @@ -51,6 +52,4 @@ RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) } } -#define RELOC_GOT(obj, offs) - #endif /* _AARCH64_ARCHDEP_H_ */ diff --git a/libexec/ld.so/sh/archdep.h b/libexec/ld.so/sh/archdep.h index 2e6aaaf8ee0..ba3febbdba6 100644 --- a/libexec/ld.so/sh/archdep.h +++ b/libexec/ld.so/sh/archdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: archdep.h,v 1.12 2019/10/23 19:55:09 guenther Exp $ */ +/* $OpenBSD: archdep.h,v 1.13 2021/11/14 22:07:39 guenther Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -30,19 +30,15 @@ #define _SH_ARCHDEP_H_ #define RELOC_TAG DT_RELA - -#define MACHID EM_SH /* ELF e_machine ID value checked */ +#define MACHID EM_SH /* ELF e_machine ID value checked */ #include <elf.h> #include <machine/reloc.h> #include "syscall.h" #include "util.h" -/* - * The following functions are declared inline so they can - * be used before bootstrap linking has been finished. - */ +/* Only used in lib/csu/boot.h */ static inline void RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) { @@ -55,6 +51,4 @@ RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) } } -#define RELOC_GOT(obj, offs) - #endif /* _SH_ARCHDEP_H_ */ diff --git a/libexec/ld.so/sparc64/archdep.h b/libexec/ld.so/sparc64/archdep.h index e4c6309f69a..3b80044a5f9 100644 --- a/libexec/ld.so/sparc64/archdep.h +++ b/libexec/ld.so/sparc64/archdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: archdep.h,v 1.26 2017/10/27 16:47:08 mpi Exp $ */ +/* $OpenBSD: archdep.h,v 1.27 2021/11/14 22:07:39 guenther Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -30,8 +30,7 @@ #define _SPARC64_ARCHDEP_H_ #define RELOC_TAG DT_RELA - -#define MACHID EM_SPARCV9 /* ELF e_machine ID value checked */ +#define MACHID EM_SPARCV9 /* ELF e_machine ID value checked */ #include <elf.h> #include <machine/reloc.h> @@ -39,6 +38,7 @@ #include "util.h" +/* Only used in lib/csu/boot.h */ static inline void RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) { @@ -49,6 +49,4 @@ RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v) } } -#define RELOC_GOT(obj, offs) - #endif /* _SPARC64_ARCHDEP_H_ */ |