mirror of
https://github.com/ziglang/zig.git
synced 2026-02-17 23:10:09 +00:00
std.process: Don't use _mh_execute_header in getBaseAddress() on BSDs.
Only the Mach-O format has this symbol.
This commit is contained in:
parent
0cf5f0d0b0
commit
d56a99442b
@ -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)),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user