mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-07 06:14:33 +00:00
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.
|
||
|---|---|---|
| .. | ||
| bpf | ||
| arm-eabi.zig | ||
| arm64.zig | ||
| bpf.zig | ||
| io_uring_sqe.zig | ||
| ioctl.zig | ||
| IoUring.zig | ||
| mips.zig | ||
| mips64.zig | ||
| powerpc.zig | ||
| powerpc64.zig | ||
| riscv32.zig | ||
| riscv64.zig | ||
| seccomp.zig | ||
| sparc64.zig | ||
| start_pie.zig | ||
| syscalls.zig | ||
| test.zig | ||
| thumb.zig | ||
| tls.zig | ||
| vdso.zig | ||
| x86.zig | ||
| x86_64.zig | ||