summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpefo <pefo@openbsd.org>2004-09-23 12:42:05 +0000
committerpefo <pefo@openbsd.org>2004-09-23 12:42:05 +0000
commit36fe9b3c2a1a10a58fb8e43e355a221ce98e150a (patch)
tree78ebdd52735c6adfd7cd2b85a76c31b997a70f79
parentClean clean clean... should be OK now (diff)
downloadwireguard-openbsd-36fe9b3c2a1a10a58fb8e43e355a221ce98e150a.tar.xz
wireguard-openbsd-36fe9b3c2a1a10a58fb8e43e355a221ce98e150a.zip
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.
-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; \