| ... | @@ -455,7 +455,6 @@ fn posixCallMainAndExit(argc_argv_ptr: [*]usize) callconv(.C) noreturn { | ... | @@ -455,7 +455,6 @@ fn posixCallMainAndExit(argc_argv_ptr: [*]usize) callconv(.C) noreturn { |
| 455 | if (native_os == .linux) { | 455 | if (native_os == .linux) { |
| 456 | // Find the beginning of the auxiliary vector | 456 | // Find the beginning of the auxiliary vector |
| 457 | const auxv: [*]elf.Auxv = @ptrCast(@alignCast(envp.ptr + envp_count + 1)); | 457 | const auxv: [*]elf.Auxv = @ptrCast(@alignCast(envp.ptr + envp_count + 1)); |
| 458 | std.os.linux.elf_aux_maybe = auxv; | | |
| 459 | | 458 | |
| 460 | var at_hwcap: usize = 0; | 459 | var at_hwcap: usize = 0; |
| 461 | const phdrs = init: { | 460 | const phdrs = init: { |
| ... | @@ -479,6 +478,10 @@ fn posixCallMainAndExit(argc_argv_ptr: [*]usize) callconv(.C) noreturn { | ... | @@ -479,6 +478,10 @@ fn posixCallMainAndExit(argc_argv_ptr: [*]usize) callconv(.C) noreturn { |
| 479 | std.os.linux.pie.relocate(phdrs); | 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 | if (!builtin.single_threaded) { | 485 | if (!builtin.single_threaded) { |
| 483 | // ARMv6 targets (and earlier) have no support for TLS in hardware. | 486 | // ARMv6 targets (and earlier) have no support for TLS in hardware. |
| 484 | // FIXME: Elide the check for targets >= ARMv7 when the target feature API | 487 | // FIXME: Elide the check for targets >= ARMv7 when the target feature API |