| ... | ... | @@ -743,14 +743,14 @@ fn __tls_get_addr(ti: *const TlsIndex) callconv(.c) *anyopaque { |
| 743 | 743 | |
| 744 | 744 | assert(ti.module == 1); // The executable's module ID is always 1 |
| 745 | 745 | const tp = getThreadPointer(); |
| 746 | | const block: [*]u8 = switch (current_variant) { |
| 747 | | .I_original => @ptrFromInt(tp -% area_info.abi_tcb.offset +% area_info.block.offset), |
| 748 | | .I_modified => @ptrFromInt(tp -% current_tp_offset), |
| 746 | const block = switch (current_variant) { |
| 747 | .I_original => tp -% area_info.abi_tcb.offset +% area_info.block.offset, |
| 748 | .I_modified => tp -% current_tp_offset, |
| 749 | 749 | // The `.I_original` approach would also work for `.II`, but there is an |
| 750 | 750 | // alternative strategy which is one less operation: |
| 751 | | .II => @ptrFromInt(tp -% area_info.block.size), |
| 751 | .II => tp -% area_info.abi_tcb.offset, |
| 752 | 752 | }; |
| 753 | | return block[@intCast(ti.offset)..]; |
| 753 | return @ptrFromInt(block +% current_dtv_offset +% @as(usize, @intCast(ti.offset))); |
| 754 | 754 | } |
| 755 | 755 | |
| 756 | 756 | fn ___tls_get_addr() callconv(.naked) *anyopaque { |
| ... | ... | @@ -772,10 +772,10 @@ fn __tls_get_offset() callconv(.naked) noreturn { |
| 772 | 772 | asm volatile ( |
| 773 | 773 | \\ la %%r1, 0(%%r12, %%r2) |
| 774 | 774 | \\ lg %%r2, 8(%%r1) |
| 775 | | \\ lgrl %%r0, %[block_size] |
| 775 | \\ lgrl %%r0, %[abi_tcb_offset] |
| 776 | 776 | \\ sgr %%r2, %%r0 |
| 777 | 777 | \\ br %%r14 |
| 778 | 778 | : |
| 779 | | : [block_size] "s" (&area_info.block.size), |
| 779 | : [abi_tcb_offset] "s" (&area_info.abi_tcb.offset), |
| 780 | 780 | ); |
| 781 | 781 | } |