diff --git a/src/ld_so/linker.rs b/src/ld_so/linker.rs index ecfc1f0172..16e2711a1c 100644 --- a/src/ld_so/linker.rs +++ b/src/ld_so/linker.rs @@ -180,11 +180,11 @@ impl Linker { for obj in new_objects.iter() { if cfg!(any(target_arch = "x86", target_arch = "x86_64")) { - // Above the TP + // Below the TP tcb.dtv_mut().unwrap()[obj.tls_module_id - 1] = tcb_ptr.cast::().sub(obj.tls_offset); } else { - // Below the TP + // Above the TP tcb.dtv_mut().unwrap()[obj.tls_module_id - 1] = tcb_ptr.add(1).cast::().add(obj.tls_offset); }