From 58cc71066429de8fbbe70b20d8fec58b7a0cf210 Mon Sep 17 00:00:00 2001 From: Dale Rahn Date: Sat, 28 Oct 2006 16:06:06 +0000 Subject: Only mprotect pages during relocation if the library is marked TEXTREL mips64 version still needs testing. --- libexec/ld.so/i386/rtld_machine.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libexec/ld.so/i386/rtld_machine.c') diff --git a/libexec/ld.so/i386/rtld_machine.c b/libexec/ld.so/i386/rtld_machine.c index 6b953bf9f1b..6662056ae20 100644 --- a/libexec/ld.so/i386/rtld_machine.c +++ b/libexec/ld.so/i386/rtld_machine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtld_machine.c,v 1.19 2005/09/22 01:33:08 drahn Exp $ */ +/* $OpenBSD: rtld_machine.c,v 1.20 2006/10/28 16:06:05 drahn Exp $ */ /* * Copyright (c) 2002 Dale Rahn @@ -185,7 +185,7 @@ _dl_md_reloc(elf_object_t *object, int rel, int relsz) /* * unprotect some segments if we need it. */ - if ((rel == DT_REL || rel == DT_RELA)) { + if ((object->dyn.textrel == 1) && (rel == DT_REL || rel == DT_RELA)) { for (llist = object->load_list; llist != NULL; llist = llist->next) { if (!(llist->prot & PROT_WRITE)) _dl_mprotect(llist->start, llist->size, @@ -304,7 +304,7 @@ resolve_failed: } /* reprotect the unprotected segments */ - if ((rel == DT_REL || rel == DT_RELA)) { + if ((object->dyn.textrel == 1) && (rel == DT_REL || rel == DT_RELA)) { for (llist = object->load_list; llist != NULL; llist = llist->next) { if (!(llist->prot & PROT_WRITE)) _dl_mprotect(llist->start, llist->size, -- cgit v1.2.3