| ... | @@ -472,10 +472,11 @@ fn posixCallMainAndExit(argc_argv_ptr: [*]usize) callconv(.C) noreturn { | ... | @@ -472,10 +472,11 @@ fn posixCallMainAndExit(argc_argv_ptr: [*]usize) callconv(.C) noreturn { |
| 472 | break :init @as([*]elf.Phdr, @ptrFromInt(at_phdr))[0..at_phnum]; | 472 | break :init @as([*]elf.Phdr, @ptrFromInt(at_phdr))[0..at_phnum]; |
| 473 | }; | 473 | }; |
| 474 | | 474 | |
| 475 | // Apply the initial relocations as early as possible in the startup | 475 | // Apply the initial relocations as early as possible in the startup process. We cannot |
| 476 | // process. | 476 | // make calls yet on some architectures (e.g. MIPS) *because* they haven't been applied yet, |
| | 477 | // so this must be fully inlined. |
| 477 | if (builtin.position_independent_executable) { | 478 | if (builtin.position_independent_executable) { |
| 478 | std.os.linux.pie.relocate(phdrs); | 479 | @call(.always_inline, std.os.linux.pie.relocate, .{phdrs}); |
| 479 | } | 480 | } |
| 480 | | 481 | |
| 481 | // This must be done after PIE relocations have been applied or we may crash | 482 | // This must be done after PIE relocations have been applied or we may crash |