diff --git a/src/ld_so/linker.rs b/src/ld_so/linker.rs index 0f9c5c2f6b..1e945bf42a 100644 --- a/src/ld_so/linker.rs +++ b/src/ld_so/linker.rs @@ -462,8 +462,10 @@ impl Linker { eprintln!("[ld.so]: moving {} into the global scope", obj.name); } - let mut global_scope = GLOBAL_SCOPE.write(); - obj.scope().copy_into(&mut global_scope); + { + let mut global_scope = GLOBAL_SCOPE.write(); + obj.scope().copy_into(&mut global_scope); + } self.scope_debug(); }