0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/lib/std/os/linux
Alex Rønne Petersen 736d37ad16
move std.os.linux.tls to compiler_rt as __zig_elf_static_tls_*
As with __zig_elf_auxv, we need a canonical location for __tls_get_addr (or
__tls_get_offset on s390x), and compiler-rt is the obvious place. But that also
means that moving all of std.os.linux.tls there just makes sense. I decided not
to namespace this under linux because it's expected that most of this code will
apply to the BSDs too.

The ABI that std now expects is:

    extern fn __zig_elf_static_tls_init(phdrs: [*]elf.ElfN.Phdr, phnum: usize) void;
    extern fn __zig_elf_static_tls_fill(area: [*]u8) usize;
    extern var __zig_elf_static_tls: extern struct {
        size: usize,
        alignment: usize,
        gdt_entry_number: usize,
    };

Users can override all three weak symbols with strong symbols if they want to
provide their own ELF TLS implementation, which may be useful to do when doing
manual dynamic loading from a static executable. Note that __tls_get_addr (or
__tls_get_offset on s390x) must also be provided, per the ELF TLS specification.
History 2026-10-05 03:26:41 +02:00
..
bpf lib: add cgroup BPF helpers 2026-02-22 20:24:51 +01:00
IoUring Use iouring probing over kernel version checks 2026-08-08 20:33:19 +02:00
aarch64.zig std.os.linux: fix some bonkers indentation in inline assembly 2026-08-09 17:53:03 +02:00
alpha.zig std.os.linux.alpha: fix some bugs in the clone assembly 2026-08-09 16:56:25 +02:00
arc.zig std.os.linux: fix some bonkers indentation in inline assembly 2026-08-09 17:53:03 +02:00
arm.zig std.os.linux: fix some bonkers indentation in inline assembly 2026-08-09 17:53:03 +02:00
bpf.zig zig fmt 2026-07-17 23:30:26 +02:00
csky.zig std.os.linux.csky: fix misleading comment in clone assembly 2026-08-09 16:56:27 +02:00
hexagon.zig std.os.linux: fix some clone() impls not passing fn return value to SYS_exit 2026-09-15 06:20:59 +02:00
io_uring_sqe.zig zig fmt 2026-07-17 23:30:26 +02:00
ioctl.zig Linux: Add proper constants for Alpha 2026-05-23 06:15:24 +02:00
IoUring.zig IoUring: fix register_file_alloc_range EINVAL err 2026-08-22 10:55:23 -07:00
loongarch32.zig zig fmt 2026-07-17 23:30:26 +02:00
loongarch64.zig zig fmt 2026-07-17 23:30:26 +02:00
m68k.zig zig fmt 2026-07-17 23:30:26 +02:00
microblaze.zig std.os.linux: fix some clone() impls not passing fn return value to SYS_exit 2026-09-15 06:20:59 +02:00
mips.zig std.os.linux: fix syscall_pipe() return value for mips 2026-09-16 03:06:10 +02:00
mips64.zig std.os.linux: fix syscall_pipe() return value for mips 2026-09-16 03:06:10 +02:00
mipsn32.zig std.os.linux: fix syscall_pipe() return value for mips 2026-09-16 03:06:10 +02:00
or1k.zig std: fix .cfi_undefined operands for or1k 2026-09-15 06:21:08 +02:00
powerpc.zig std.os.linux: fix some bonkers indentation in inline assembly 2026-08-09 17:53:03 +02:00
powerpc64.zig std.os.linux: fix some bonkers indentation in inline assembly 2026-08-09 17:53:03 +02:00
riscv32.zig std.os.linux.riscv(32,64): declare all vector registers as syscall clobbers 2026-10-04 04:52:13 +02:00
riscv64.zig std.os.linux.riscv(32,64): declare all vector registers as syscall clobbers 2026-10-04 04:52:13 +02:00
s390x.zig std.os.linux: fix some bonkers indentation in inline assembly 2026-08-09 17:53:03 +02:00
seccomp.zig std.builtin.Endian: make the tags lower case 2023-10-31 21:37:35 -04:00
sh.zig std.os.linux: fix some clone() impls not passing fn return value to SYS_exit 2026-09-15 06:20:59 +02:00
sparc.zig std.os.linux.sparc: delete incorrect stack bias in clone assembly 2026-08-09 17:53:03 +02:00
sparc64.zig std.os.linux: fix restore_rt() on sparc/sparc64 2026-08-01 15:20:10 +02:00
syscalls.zig std.os.linux: update syscalls to 7.1 2026-06-15 14:57:10 +02:00
test.zig std.elf: add AT_* constants for more OSs and namespace them properly 2026-09-07 01:29:49 +02:00
thumb.zig zig fmt 2026-07-17 23:30:26 +02:00
vdso.zig move std.os.linux.elf_aux_maybe to compiler_rt as __zig_elf_auxv 2026-10-05 03:26:41 +02:00
x32.zig std.os.linux: fix some bonkers indentation in inline assembly 2026-08-09 17:53:03 +02:00
x86.zig std.os.linux: fix some bonkers indentation in inline assembly 2026-08-09 17:53:03 +02:00
x86_64.zig std.os.linux: fix some bonkers indentation in inline assembly 2026-08-09 17:53:03 +02:00
xtensa.zig std.os.linux: fix some clone() impls not passing fn return value to SYS_exit 2026-09-15 06:20:59 +02:00