zig/lib/std/os
Alex Rønne Petersen 2386bfe854
std.os.linux.start_pie: Rewrite relocate() to avoid jump tables and libcalls.
The code would cause LLVM to emit a jump table for the switch in the loop over
the dynamic tags. That jump table was far enough away that the compiler decided
to go through the GOT, which would of course break at this early stage as we
haven't applied MIPS's local GOT relocations yet, nor can we until we've walked
through the _DYNAMIC array.

The first attempt at rewriting this used code like this:

    var sorted_dynv = [_]elf.Addr{0} ** elf.DT_NUM;

But this is also problematic as it results in a memcpy() call. Instead, we
explicitly initialize it to undefined and use a loop of volatile stores to
clear it.
2024-07-30 01:26:10 +02:00
..
linux std.os.linux.start_pie: Rewrite relocate() to avoid jump tables and libcalls. 2024-07-30 01:26:10 +02:00
plan9 extract std.posix from std.os 2024-03-19 11:45:09 -07:00
uefi chore: correct non-standard comments. 2024-07-28 21:34:14 -07:00
windows Fix compile error due to GetModuleFileNameW binding change 2024-07-29 16:06:36 -07:00
emscripten.zig std.c reorganization 2024-07-19 00:30:32 -07:00
linux.zig std: Stop supporting Linux/glibc versions older than declared in std.Target. 2024-07-29 09:50:41 +02:00
plan9.zig std: fix typos (#20560) 2024-07-09 14:25:42 -07:00
uefi.zig os.uefi: add ns to epoch 2023-12-20 20:05:16 -08:00
wasi.zig Do not run asserts for WASI alignment when not targeting WASI 2024-05-11 07:23:07 +00:00
windows.zig Watch.zig: add initial windows implementation 2024-07-27 11:32:43 -04:00