summaryrefslogtreecommitdiff
path: root/libexec/ld.so
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2002-08-12 01:05:24 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2002-08-12 01:05:24 +0000
commit5ae8f3912303a67574ac7c5c87970a0da1cc6ca5 (patch)
tree8d827a0b0e30bc32010dfd78c370561617261961 /libexec/ld.so
parent718ee9c261dd75c43164ea69c0c25a11734a99bc (diff)
Add support for REL type relocations, all currently supported arch
use only RELA type relocations, but that could change. ok art@
Diffstat (limited to 'libexec/ld.so')
-rw-r--r--libexec/ld.so/alpha/archdep.h9
-rw-r--r--libexec/ld.so/loader.c4
-rw-r--r--libexec/ld.so/powerpc/archdep.h9
-rw-r--r--libexec/ld.so/sparc/archdep.h9
-rw-r--r--libexec/ld.so/sparc64/archdep.h9
5 files changed, 33 insertions, 7 deletions
diff --git a/libexec/ld.so/alpha/archdep.h b/libexec/ld.so/alpha/archdep.h
index 8ec8942cd6d..510da23b5ec 100644
--- a/libexec/ld.so/alpha/archdep.h
+++ b/libexec/ld.so/alpha/archdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: archdep.h,v 1.6 2002/05/24 03:44:37 deraadt Exp $ */
+/* $OpenBSD: archdep.h,v 1.7 2002/08/12 01:05:23 drahn Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -48,6 +48,13 @@
#include "util.h"
static inline void
+RELOC_REL(Elf64_Rel *r, const Elf64_Sym *s, Elf64_Addr *p, unsigned long v)
+{
+ /* Alpha does not use REL type relocations */
+ _dl_exit(20);
+}
+
+static inline void
RELOC_RELA(Elf64_Rela *r, const Elf64_Sym *s, Elf64_Addr *p, unsigned long v)
{
extern Elf_Addr _GLOBAL_OFFSET_TABLE_[];
diff --git a/libexec/ld.so/loader.c b/libexec/ld.so/loader.c
index 9fba86b56a2..819c5c18d22 100644
--- a/libexec/ld.so/loader.c
+++ b/libexec/ld.so/loader.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: loader.c,v 1.46 2002/08/11 18:41:17 drahn Exp $ */
+/* $OpenBSD: loader.c,v 1.47 2002/08/12 01:05:23 drahn Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -440,9 +440,7 @@ _dl_boot_bind(const long sp, long loff, Elf_Dyn *dynamicp, long *dl_data)
}
ra = (Elf_Addr *)(rp->r_offset + loff);
- /*
RELOC_REL(rp, sp, ra, loff);
- */
rp++;
}
diff --git a/libexec/ld.so/powerpc/archdep.h b/libexec/ld.so/powerpc/archdep.h
index fe20594845a..8107d1af87f 100644
--- a/libexec/ld.so/powerpc/archdep.h
+++ b/libexec/ld.so/powerpc/archdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: archdep.h,v 1.8 2002/07/12 20:18:30 drahn Exp $ */
+/* $OpenBSD: archdep.h,v 1.9 2002/08/12 01:05:23 drahn Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -70,6 +70,13 @@ _dl_dcbf(Elf32_Addr *addr)
}
static inline void
+RELOC_REL(Elf_Rel *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
+{
+ /* PowerPC does not use REL type relocations */
+ _dl_exit(20);
+}
+
+static inline void
RELOC_RELA(Elf32_Rela *r, const Elf32_Sym *s, Elf32_Addr *p, unsigned long v)
{
if (ELF32_R_TYPE(r->r_info) == RELOC_RELATIVE) {
diff --git a/libexec/ld.so/sparc/archdep.h b/libexec/ld.so/sparc/archdep.h
index aeee5b968a2..a001a357e0b 100644
--- a/libexec/ld.so/sparc/archdep.h
+++ b/libexec/ld.so/sparc/archdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: archdep.h,v 1.2 2002/07/27 15:36:53 art Exp $ */
+/* $OpenBSD: archdep.h,v 1.3 2002/08/12 01:05:23 drahn Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -58,6 +58,13 @@ _dl_mmap(void *addr, unsigned int len, unsigned int prot,
}
static inline void
+RELOC_REL(Elf_Rel *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
+{
+ /* SPARC does not use REL type relocations */
+ _dl_exit(20);
+}
+
+static inline void
RELOC_RELA(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
{
if (ELF_R_TYPE(r->r_info) == R_TYPE(NONE)) {
diff --git a/libexec/ld.so/sparc64/archdep.h b/libexec/ld.so/sparc64/archdep.h
index d0bbe088410..2c56ffe9d02 100644
--- a/libexec/ld.so/sparc64/archdep.h
+++ b/libexec/ld.so/sparc64/archdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: archdep.h,v 1.12 2002/07/24 04:11:10 deraadt Exp $ */
+/* $OpenBSD: archdep.h,v 1.13 2002/08/12 01:05:23 drahn Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -58,6 +58,13 @@ _dl_mmap(void *addr, unsigned int len, unsigned int prot,
}
static inline void
+RELOC_REL(Elf_Rel *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
+{
+ /* SPARC64 does not use REL type relocations */
+ _dl_exit(20);
+}
+
+static inline void
RELOC_RELA(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
{
if (ELF_R_TYPE(r->r_info) == RELOC_RELATIVE) {