summaryrefslogtreecommitdiff
path: root/libexec/ld.so
diff options
context:
space:
mode:
authorPer Fogelstrom <pefo@cvs.openbsd.org>2004-09-23 12:42:06 +0000
committerPer Fogelstrom <pefo@cvs.openbsd.org>2004-09-23 12:42:06 +0000
commit339d5e8a70c9a97d437aebeceacdf3104e4fbeae (patch)
tree71d68b2deac2255cf50d3e045a5d3813e44a8e80 /libexec/ld.so
parent718ad1167fb0f01b629cbec9811f032af1a20cd5 (diff)
When doing relocs to .rodata this section must be RW protected.
It would be nice to fix this so it does not do a mprotect call for each and every reloc but it will need a change in MI code so we just fix it like this for now. There are not so many relocs in ld.so itself.
Diffstat (limited to 'libexec/ld.so')
-rw-r--r--libexec/ld.so/mips64/archdep.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/libexec/ld.so/mips64/archdep.h b/libexec/ld.so/mips64/archdep.h
index 8700f711a0f..12d47ce6bfa 100644
--- a/libexec/ld.so/mips64/archdep.h
+++ b/libexec/ld.so/mips64/archdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: archdep.h,v 1.3 2004/09/21 08:40:45 pefo Exp $ */
+/* $OpenBSD: archdep.h,v 1.4 2004/09/23 12:42:05 pefo Exp $ */
/*
* Copyright (c) 1998-2002 Opsycon AB, Sweden.
@@ -36,11 +36,12 @@
#include "util.h"
#define DL_MALLOC_ALIGN 8 /* Arch constraint or otherwise */
-
#define MACHID EM_MIPS /* ELF e_machine ID value checked */
+
#define RELOC_REL(relp, symp, adrp, val) \
do { \
+ _dl_mprotect(adrp, 8, PROT_EXEC|PROT_READ|PROT_WRITE); \
if (ELF64_R_TYPE(relp->r_info) == R_MIPS_REL32_64) { \
if (ELF64_R_SYM(rp->r_info) != 0) \
*adrp = symp->st_value + val; \