zig/lib/std/os/linux
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
..
bpf linux/bpf: update helper definitions 2023-11-19 19:01:18 +02:00
arm-eabi.zig fix regression of flock being called on wasi targets 2024-07-19 11:35:22 -07:00
arm64.zig fix regression of flock being called on wasi targets 2024-07-19 11:35:22 -07:00
bpf.zig std: fix typos (#20560) 2024-07-09 14:25:42 -07:00
io_uring_sqe.zig std.posix.iovec: use .base and .len instead of .iov_base and .iov_len 2024-04-28 00:20:30 -07:00
ioctl.zig all: migrate code to new cast builtin syntax 2023-06-24 16:56:39 -07:00
IoUring.zig add std.testing.random_seed 2024-07-23 11:43:12 -07:00
mips.zig fix regression of flock being called on wasi targets 2024-07-19 11:35:22 -07:00
mips64.zig fix regression of flock being called on wasi targets 2024-07-19 11:35:22 -07:00
powerpc.zig fix regression of flock being called on wasi targets 2024-07-19 11:35:22 -07:00
powerpc64.zig fix regression of flock being called on wasi targets 2024-07-19 11:35:22 -07:00
riscv32.zig std.os.linux: Add riscv32 support. 2024-07-29 09:50:41 +02:00
riscv64.zig std.os.linux: Add riscv32 support. 2024-07-29 09:50:41 +02:00
seccomp.zig std.builtin.Endian: make the tags lower case 2023-10-31 21:37:35 -04:00
sparc64.zig fix regression of flock being called on wasi targets 2024-07-19 11:35:22 -07:00
start_pie.zig std.os.linux.start_pie: Rewrite relocate() to avoid jump tables and libcalls. 2024-07-30 01:26:10 +02:00
syscalls.zig std.os.linux.syscalls: Regenerate based on Linux v6.7. 2024-07-29 09:50:41 +02:00
test.zig std: Stop supporting Linux/glibc versions older than declared in std.Target. 2024-07-29 09:50:41 +02:00
thumb.zig std: finish cleanup up asm 2023-07-31 03:49:21 -04:00
tls.zig std.os.linux.tls: Handle riscv32 in setThreadPointer(). 2024-07-29 09:50:41 +02:00
vdso.zig extract std.posix from std.os 2024-03-19 11:45:09 -07:00
x86.zig fix regression of flock being called on wasi targets 2024-07-19 11:35:22 -07:00
x86_64.zig fix regression of flock being called on wasi targets 2024-07-19 11:35:22 -07:00