summaryrefslogtreecommitdiff
path: root/libexec/ld.so/i386/rtld_machine.c
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2006-10-28 16:06:06 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2006-10-28 16:06:06 +0000
commit58cc71066429de8fbbe70b20d8fec58b7a0cf210 (patch)
tree9b4683b9e5da68e5eb0e93717c4ac900aff1af1e /libexec/ld.so/i386/rtld_machine.c
parent2274ecbafc5feccc47349e9aa0a163415fae4626 (diff)
Only mprotect pages during relocation if the library is marked TEXTREL
mips64 version still needs testing.
Diffstat (limited to 'libexec/ld.so/i386/rtld_machine.c')
-rw-r--r--libexec/ld.so/i386/rtld_machine.c6
1 files changed, 3 insertions, 3 deletions
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,