summaryrefslogtreecommitdiff
path: root/libexec/ld.so/sparc
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/sparc
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/sparc')
-rw-r--r--libexec/ld.so/sparc/rtld_machine.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libexec/ld.so/sparc/rtld_machine.c b/libexec/ld.so/sparc/rtld_machine.c
index f14d49a69b1..cc3489b37bc 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.27 2006/10/28 16:06:05 drahn Exp $ */
+/* $OpenBSD: rtld_machine.c,v 1.28 2007/05/05 15:21:21 drahn Exp $ */
/*
* Copyright (c) 1999 Dale Rahn
@@ -340,6 +340,7 @@ _dl_bind(elf_object_t *object, int reloff)
if (object->plt_size != 0) {
sigfillset(&nmask);
_dl_sigprocmask(SIG_BLOCK, &nmask, &omask);
+ _dl_thread_bind_lock(0);
/* mprotect the actual modified region, not the whole plt */
_dl_mprotect((void*)addr, sizeof (Elf_Addr) * 3,
PROT_READ|PROT_WRITE|PROT_EXEC);
@@ -352,6 +353,7 @@ _dl_bind(elf_object_t *object, int reloff)
/* mprotect the actual modified region, not the whole plt */
_dl_mprotect((void*)addr, sizeof (Elf_Addr) * 3,
PROT_READ|PROT_EXEC);
+ _dl_thread_bind_lock(1);
_dl_sigprocmask(SIG_SETMASK, &omask, NULL);
}