mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-05 12:56:08 +00:00
rtld-elf: Avoid unnecessary lock_restart_for_upgrade() calls
In order to atomically upgrade the rtld bind lock, load_filtees() may trigger a longjmp back to _rtld_bind() so that the binding can be done with the write lock held. However, the write lock is only needed when filtee objects haven't already been loaded, so move the lock_restart_for_upgrade() call to avoid unnecessary lock upgrades when a filtee is defined. Reviewed by: kib Tested by: brooks MFC after: 1 week Sponsored by: Innovate UK
This commit is contained in:
parent
9bbe06b004
commit
e7951d0b04
@ -2583,8 +2583,8 @@ static void
|
||||
load_filtees(Obj_Entry *obj, int flags, RtldLockState *lockstate)
|
||||
{
|
||||
|
||||
lock_restart_for_upgrade(lockstate);
|
||||
if (!obj->filtees_loaded) {
|
||||
lock_restart_for_upgrade(lockstate);
|
||||
load_filtee1(obj, obj->needed_filtees, flags, lockstate);
|
||||
load_filtee1(obj, obj->needed_aux_filtees, flags, lockstate);
|
||||
obj->filtees_loaded = true;
|
||||
|
Loading…
Reference in New Issue
Block a user