From 68cebde186eb8507509c9418c1ab3b843c6f24ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Thu, 25 Jul 2024 19:02:26 +0200 Subject: [PATCH] std.os.linux.start_pie: Inline the getDynamicSymbol() function. On MIPS, this call will require a relocation, which we can't do until after PIE relocations have been applied. --- lib/std/os/linux/start_pie.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/os/linux/start_pie.zig b/lib/std/os/linux/start_pie.zig index 174d5640ad..ab44abd898 100644 --- a/lib/std/os/linux/start_pie.zig +++ b/lib/std/os/linux/start_pie.zig @@ -38,7 +38,7 @@ const R_RELATIVE = switch (builtin.cpu.arch) { // Obtain a pointer to the _DYNAMIC array. // We have to compute its address as a PC-relative quantity not to require a // relocation that, at this point, is not yet applied. -fn getDynamicSymbol() [*]elf.Dyn { +inline fn getDynamicSymbol() [*]elf.Dyn { return switch (builtin.cpu.arch) { .x86 => asm volatile ( \\ .weak _DYNAMIC