summaryrefslogtreecommitdiff
path: root/libexec/ld.so/amd64
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2007-05-05 15:21:22 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2007-05-05 15:21:22 +0000
commitb769e807d32df4b2769d521a9f2e07fa5636ad46 (patch)
treea84bec994dddd31b2cb2cb0ba6947ebfc34e71e2 /libexec/ld.so/amd64
parent65314bd4b49f9cce5a6d3f3c9cf77bc7272e60fa (diff)
Provide hook so that rthreads can provide a spinlock to protect from races
in lazy binding. ok art@, kurt@
Diffstat (limited to 'libexec/ld.so/amd64')
-rw-r--r--libexec/ld.so/amd64/rtld_machine.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libexec/ld.so/amd64/rtld_machine.c b/libexec/ld.so/amd64/rtld_machine.c
index fdeaf40a848..5d5956a0e99 100644
--- a/libexec/ld.so/amd64/rtld_machine.c
+++ b/libexec/ld.so/amd64/rtld_machine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtld_machine.c,v 1.11 2006/10/28 16:06:05 drahn Exp $ */
+/* $OpenBSD: rtld_machine.c,v 1.12 2007/05/05 15:21:21 drahn Exp $ */
/*
* Copyright (c) 2002,2004 Dale Rahn
@@ -364,6 +364,7 @@ _dl_bind(elf_object_t *object, int index)
if (object->got_size != 0) {
sigfillset(&nmask);
_dl_sigprocmask(SIG_BLOCK, &nmask, &omask);
+ _dl_thread_bind_lock(0);
_dl_mprotect((void*)object->got_start, object->got_size,
PROT_READ|PROT_WRITE);
}
@@ -374,6 +375,7 @@ _dl_bind(elf_object_t *object, int index)
if (object->got_size != 0) {
_dl_mprotect((void*)object->got_start, object->got_size,
PROT_READ);
+ _dl_thread_bind_lock(1);
_dl_sigprocmask(SIG_SETMASK, &omask, NULL);
}