diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2006-10-28 16:06:06 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2006-10-28 16:06:06 +0000 |
commit | 58cc71066429de8fbbe70b20d8fec58b7a0cf210 (patch) | |
tree | 9b4683b9e5da68e5eb0e93717c4ac900aff1af1e /libexec/ld.so/sparc/rtld_machine.c | |
parent | 2274ecbafc5feccc47349e9aa0a163415fae4626 (diff) |
Only mprotect pages during relocation if the library is marked TEXTREL
mips64 version still needs testing.
Diffstat (limited to 'libexec/ld.so/sparc/rtld_machine.c')
-rw-r--r-- | libexec/ld.so/sparc/rtld_machine.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libexec/ld.so/sparc/rtld_machine.c b/libexec/ld.so/sparc/rtld_machine.c index 541d5840e01..f14d49a69b1 100644 --- a/libexec/ld.so/sparc/rtld_machine.c +++ b/libexec/ld.so/sparc/rtld_machine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtld_machine.c,v 1.26 2005/09/22 01:33:08 drahn Exp $ */ +/* $OpenBSD: rtld_machine.c,v 1.27 2006/10/28 16:06:05 drahn Exp $ */ /* * Copyright (c) 1999 Dale Rahn @@ -194,7 +194,7 @@ _dl_md_reloc(elf_object_t *object, int rel, int relasz) /* * 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, @@ -294,7 +294,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, |