summaryrefslogtreecommitdiff
path: root/libexec/ld.so
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2014-12-30 19:26:39 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2014-12-30 19:26:39 +0000
commitf07ea94e3586ffe0e8b20b31d970d476c0394b5a (patch)
tree360f7767b9905cde85e5596e92a73451cdc1e84b /libexec/ld.so
parent08e9934e5378555bc60ace0d2f569fc3845624aa (diff)
self-relocating crt0 bits for sh, and enable static pie by default. With some
archdep.h help from kettenis@
Diffstat (limited to 'libexec/ld.so')
-rw-r--r--libexec/ld.so/sh/archdep.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libexec/ld.so/sh/archdep.h b/libexec/ld.so/sh/archdep.h
index 8da20ac5a43..00f8aaf87ea 100644
--- a/libexec/ld.so/sh/archdep.h
+++ b/libexec/ld.so/sh/archdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: archdep.h,v 1.3 2014/07/05 12:22:41 miod Exp $ */
+/* $OpenBSD: archdep.h,v 1.4 2014/12/30 19:26:38 miod Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -74,6 +74,8 @@ RELOC_RELA(Elf32_Rela *r, const Elf32_Sym *s, Elf32_Addr *p, unsigned long v,
{
if (ELF_R_TYPE(r->r_info) == R_SH_RELATIVE) {
*p = v + r->r_addend;
+ } else if (ELF_R_TYPE(r->r_info) == R_SH_DIR32) {
+ *p = s->st_value + v + r->r_addend;
} else {
/* XXX - printf might not work here, but we give it a shot. */
_dl_printf("Unknown bootstrap relocation.\n");