| ... | ... | @@ -1651,14 +1651,15 @@ pub fn posixGetUserInfo(name: []const u8) !UserInfo { |
| 1651 | 1651 | pub fn getBaseAddress() usize { |
| 1652 | 1652 | switch (native_os) { |
| 1653 | 1653 | .linux => { |
| 1654 | | const base = std.os.linux.getauxval(std.elf.AT_BASE); |
| 1654 | const getauxval = if (builtin.link_libc) std.c.getauxval else std.os.linux.getauxval; |
| 1655 | const base = getauxval(std.elf.AT_BASE); |
| 1655 | 1656 | if (base != 0) { |
| 1656 | 1657 | return base; |
| 1657 | 1658 | } |
| 1658 | | const phdr = std.os.linux.getauxval(std.elf.AT_PHDR); |
| 1659 | const phdr = getauxval(std.elf.AT_PHDR); |
| 1659 | 1660 | return phdr - @sizeOf(std.elf.Ehdr); |
| 1660 | 1661 | }, |
| 1661 | | .macos, .freebsd, .netbsd => { |
| 1662 | .driverkit, .ios, .macos, .tvos, .visionos, .watchos => { |
| 1662 | 1663 | return @intFromPtr(&std.c._mh_execute_header); |
| 1663 | 1664 | }, |
| 1664 | 1665 | .windows => return @intFromPtr(windows.kernel32.GetModuleHandleW(null)), |