diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2007-05-05 15:21:22 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2007-05-05 15:21:22 +0000 |
commit | b769e807d32df4b2769d521a9f2e07fa5636ad46 (patch) | |
tree | a84bec994dddd31b2cb2cb0ba6947ebfc34e71e2 /libexec/ld.so/sh | |
parent | 65314bd4b49f9cce5a6d3f3c9cf77bc7272e60fa (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/sh')
-rw-r--r-- | libexec/ld.so/sh/rtld_machine.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libexec/ld.so/sh/rtld_machine.c b/libexec/ld.so/sh/rtld_machine.c index 9865e2af09e..9af19cfd91c 100644 --- a/libexec/ld.so/sh/rtld_machine.c +++ b/libexec/ld.so/sh/rtld_machine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtld_machine.c,v 1.7 2007/03/07 18:50:02 drahn Exp $ */ +/* $OpenBSD: rtld_machine.c,v 1.8 2007/05/05 15:21:21 drahn Exp $ */ /* * Copyright (c) 2004 Dale Rahn @@ -858,6 +858,7 @@ _dl_bind(elf_object_t *object, int relidx) 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); } @@ -870,6 +871,7 @@ _dl_bind(elf_object_t *object, int relidx) _dl_mprotect((void*)object->got_start, object->got_size, PROT_READ); _dl_sigprocmask(SIG_SETMASK, &omask, NULL); + _dl_thread_bind_lock(1); } return newval; } |