summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2019-11-10 22:20:10 +0000
committerguenther <guenther@openbsd.org>2019-11-10 22:20:10 +0000
commit5b60b03c22549481a9cd61643de55eb8aa0972dd (patch)
tree8308a252460b05241f7abe807118ef947d5fa74a /libexec
parentRecommit CHECK_LDSO bits for mips64, verified on both loongson and octeon. (diff)
downloadwireguard-openbsd-5b60b03c22549481a9cd61643de55eb8aa0972dd.tar.xz
wireguard-openbsd-5b60b03c22549481a9cd61643de55eb8aa0972dd.zip
unifdef HAVE_JMPREL, delete dt_pltrelsz handling (which was only used
in the HAVE_JMPREL case anyway), and reduce #includes to match boot.c ok visa@
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ld.so/mips64/boot_md.c36
1 files changed, 2 insertions, 34 deletions
diff --git a/libexec/ld.so/mips64/boot_md.c b/libexec/ld.so/mips64/boot_md.c
index 4d1604b9923..2ca2b082b6f 100644
--- a/libexec/ld.so/mips64/boot_md.c
+++ b/libexec/ld.so/mips64/boot_md.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: boot_md.c,v 1.1 2019/10/20 03:44:49 guenther Exp $ */
+/* $OpenBSD: boot_md.c,v 1.2 2019/11/10 22:20:10 guenther Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -34,13 +34,7 @@
#define _DYN_LOADER
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <sys/exec.h>
-#include <sys/sysctl.h>
-#include <nlist.h>
-#include <link.h>
-#include <dlfcn.h>
+#include <sys/exec_elf.h>
#include "syscall.h"
#include "archdep.h"
@@ -61,11 +55,7 @@ struct boot_dyn {
RELOC_TYPE *dt_reloc; /* DT_RELA or DT_REL */
Elf_Addr dt_relocsz; /* DT_RELASZ or DT_RELSZ */
Elf_Addr *dt_pltgot;
- Elf_Addr dt_pltrelsz;
const Elf_Sym *dt_symtab;
-#ifdef HAVE_JMPREL
- RELOC_TYPE *dt_jmprel;
-#endif
#if DT_PROCNUM > 0
u_long dt_proc[DT_PROCNUM];
#endif
@@ -134,14 +124,8 @@ _dl_boot_bind(const long sp, long *dl_data, Elf_Dyn *dynp)
dynld.dt_symtab = (void *)(dynp->d_un.d_ptr + loff);
else if (dynp->d_tag == RELOC_TAG) /* DT_{RELA,REL} */
dynld.dt_reloc = (void *)(dynp->d_un.d_ptr + loff);
-#ifdef HAVE_JMPREL
- else if (dynp->d_tag == DT_JMPREL)
- dynld.dt_jmprel = (void *)(dynp->d_un.d_ptr + loff);
-#endif
/* Now for the tags that are just sizes or counts */
- else if (dynp->d_tag == DT_PLTRELSZ)
- dynld.dt_pltrelsz = dynp->d_un.d_val;
else if (dynp->d_tag == RELOC_TAG+1) /* DT_{RELA,REL}SZ */
dynld.dt_relocsz = dynp->d_un.d_val;
#if DT_PROCNUM > 0
@@ -153,22 +137,6 @@ _dl_boot_bind(const long sp, long *dl_data, Elf_Dyn *dynp)
dynp++;
}
-#ifdef HAVE_JMPREL
- rp = dynld.dt_jmprel;
- for (i = 0; i < dynld.dt_pltrelsz; i += sizeof *rp) {
- Elf_Addr *ra;
- const Elf_Sym *sp;
-
- sp = dynld.dt_symtab + ELF_R_SYM(rp->r_info);
- if (ELF_R_SYM(rp->r_info) && sp->st_value == 0)
- _dl_exit(5);
-
- ra = (Elf_Addr *)(rp->r_offset + loff);
- RELOC_JMPREL(rp, sp, ra, loff, dynld.dt_pltgot);
- rp++;
- }
-#endif /* HAVE_JMPREL */
-
rp = dynld.dt_reloc;
for (i = 0; i < dynld.dt_relocsz; i += sizeof *rp) {
Elf_Addr *ra;