| ... | ... | @@ -455,7 +455,6 @@ fn posixCallMainAndExit(argc_argv_ptr: [*]usize) callconv(.C) noreturn { |
| 455 | 455 | if (native_os == .linux) { |
| 456 | 456 | // Find the beginning of the auxiliary vector |
| 457 | 457 | const auxv: [*]elf.Auxv = @ptrCast(@alignCast(envp.ptr + envp_count + 1)); |
| 458 | | std.os.linux.elf_aux_maybe = auxv; |
| 459 | 458 | |
| 460 | 459 | var at_hwcap: usize = 0; |
| 461 | 460 | const phdrs = init: { |
| ... | ... | @@ -479,6 +478,10 @@ fn posixCallMainAndExit(argc_argv_ptr: [*]usize) callconv(.C) noreturn { |
| 479 | 478 | std.os.linux.pie.relocate(phdrs); |
| 480 | 479 | } |
| 481 | 480 | |
| 481 | // This must be done after PIE relocations have been applied or we may crash |
| 482 | // while trying to access the global variable (happens on MIPS at least). |
| 483 | std.os.linux.elf_aux_maybe = auxv; |
| 484 | |
| 482 | 485 | if (!builtin.single_threaded) { |
| 483 | 486 | // ARMv6 targets (and earlier) have no support for TLS in hardware. |
| 484 | 487 | // FIXME: Elide the check for targets >= ARMv7 when the target feature API |