From d56a99442becc38a74dddd1189530c13e39e9b2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 26 Mar 2025 18:27:43 +0100 Subject: [PATCH] std.process: Don't use _mh_execute_header in getBaseAddress() on BSDs. Only the Mach-O format has this symbol. --- lib/std/process.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/process.zig b/lib/std/process.zig index 3320513b0f..6c9ae4eb50 100644 --- a/lib/std/process.zig +++ b/lib/std/process.zig @@ -1660,7 +1660,7 @@ pub fn getBaseAddress() usize { const phdr = getauxval(std.elf.AT_PHDR); return phdr - @sizeOf(std.elf.Ehdr); }, - .macos, .freebsd, .netbsd => { + .macos => { return @intFromPtr(&std.c._mh_execute_header); }, .windows => return @intFromPtr(windows.kernel32.GetModuleHandleW(null)),