summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2003-02-15 00:30:17 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2003-02-15 00:30:17 +0000
commitd9e1f5a7828cb57f270071042410892e43afe214 (patch)
tree8febebb6a6d7a055adc3e448d6a88d5fc2b9e491 /libexec
parent0fa9698a9a8355f9faa5eb55e8c91c6ebffd167c (diff)
Do not call mprotect to enable writing for sections which normally are
writable. Idea taken from alpha version. Saves many mprotect syscalls.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ld.so/powerpc/rtld_machine.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libexec/ld.so/powerpc/rtld_machine.c b/libexec/ld.so/powerpc/rtld_machine.c
index db8093904f8..8c5b1e89535 100644
--- a/libexec/ld.so/powerpc/rtld_machine.c
+++ b/libexec/ld.so/powerpc/rtld_machine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtld_machine.c,v 1.22 2003/02/02 16:57:58 deraadt Exp $ */
+/* $OpenBSD: rtld_machine.c,v 1.23 2003/02/15 00:30:16 drahn Exp $ */
/*
* Copyright (c) 1999 Dale Rahn
@@ -170,8 +170,9 @@ _dl_printf("object relocation size %x, numrela %x\n",
*/
load_list = object->load_list;
while (load_list != NULL) {
- _dl_mprotect(load_list->start, load_list->size,
- load_list->prot|PROT_WRITE);
+ if ((load_list->prot & PROT_WRITE) == 0)
+ _dl_mprotect(load_list->start, load_list->size,
+ load_list->prot|PROT_WRITE);
load_list = load_list->next;
}
@@ -431,7 +432,9 @@ _dl_printf(" found other symbol at %x size %d\n",
}
load_list = object->load_list;
while (load_list != NULL) {
- _dl_mprotect(load_list->start, load_list->size, load_list->prot);
+ if ((load_list->prot & PROT_WRITE) == 0)
+ _dl_mprotect(load_list->start, load_list->size,
+ load_list->prot);
load_list = load_list->next;
}
return(fails);