diff --git a/ape/aarch64.lds b/ape/aarch64.lds new file mode 100644 index 000000000..48dcecb32 --- /dev/null +++ b/ape/aarch64.lds @@ -0,0 +1,298 @@ +/*-*- mode: ld-script; indent-tabs-mode: nil; tab-width: 2; coding: utf-8 -*-│ +│vi: set et sts=2 tw=2 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Copyright 2023 Justine Alexandra Roberts Tunney │ +│ │ +│ Permission to use, copy, modify, and/or distribute this software for │ +│ any purpose with or without fee is hereby granted, provided that the │ +│ above copyright notice and this permission notice appear in all copies. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ +│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ +│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ +│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ +│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ +│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ +│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ +│ PERFORMANCE OF THIS SOFTWARE. │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/zip.h" + +ENTRY(_start) +OUTPUT_ARCH(aarch64) +OUTPUT_FORMAT("elf64-littleaarch64", + "elf64-bigaarch64", + "elf64-littleaarch64") + +SECTIONS { + + PROVIDE(__executable_start = SEGMENT_START("text-segment", IMAGE_BASE_VIRTUAL)); + . = SEGMENT_START("text-segment", IMAGE_BASE_VIRTUAL) + SIZEOF_HEADERS; + + .interp : { *(.interp) } + .note.gnu.build-id : { *(.note.gnu.build-id) } + .hash : { *(.hash) } + .gnu.hash : { *(.gnu.hash) } + .dynsym : { *(.dynsym) } + .dynstr : { *(.dynstr) } + .gnu.version : { *(.gnu.version) } + .gnu.version_d : { *(.gnu.version_d) } + .gnu.version_r : { *(.gnu.version_r) } + .rela.init : { *(.rela.init) } + .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } + .rela.fini : { *(.rela.fini) } + .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } + .rela.data.rel.ro : { *(.rela.data.rel.ro .rela.data.rel.ro.* .rela.gnu.linkonce.d.rel.ro.*) } + .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } + .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } + .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } + .rela.ctors : { *(.rela.ctors) } + .rela.dtors : { *(.rela.dtors) } + .rela.got : { *(.rela.got) } + .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } + .rela.ifunc : { *(.rela.ifunc) } + + .rela.plt : { + *(.rela.plt) + PROVIDE_HIDDEN(__rela_iplt_start = .); + *(.rela.iplt) + PROVIDE_HIDDEN(__rela_iplt_end = .); + } + + .init : { + KEEP(*(.initprologue)) + KEEP(*(SORT_NONE(.init))) + KEEP(*(.initepilogue)) + } =0x1f2003d5 + + .plt : ALIGN(16) { + *(.plt) + *(.iplt) + } + + .text : { + *(.text.unlikely .text.*_unlikely .text.unlikely.*) + *(.text.antiquity .text.antiquity.*) + *(.text.exit .text.exit.*) + *(.text.startup .text.startup.*) + *(.text.hot .text.hot.*) + *(.text.modernity .text.modernity.*) + *(.text .stub .text.* .gnu.linkonce.t.*) + *(.gnu.warning) + } =0x1f2003d5 + + .fini : { + KEEP(*(SORT_NONE(.fini))) + } =0x1f2003d5 + + .privileged : { + PROVIDE_HIDDEN(__privileged_start = .); + *(.privileged*) + PROVIDE_HIDDEN(__privileged_end = .); + } + + .rodata : { + KEEP(*(.rodata.pytab.0)); + KEEP(*(.rodata.pytab.1)); + KEEP(*(.rodata.pytab.2)); + KEEP(*(SORT_BY_NAME(.sort.rodata.*))) + *(.rodata .rodata.* .gnu.linkonce.r.*) + *(.ubsan.types) + *(.ubsan.data) + } + + .comment : { + KEEP(*(.commentprologue)) + KEEP(*(.comment)) + KEEP(*(.commentepilogue)) + } + + .eh_frame_hdr : { + *(.eh_frame_hdr) + *(.eh_frame_entry .eh_frame_entry.*) + } + + .eh_frame : ONLY_IF_RO { + KEEP(*(.eh_frame)) + *(.eh_frame.*) + } + + .gcc_except_table : ONLY_IF_RO { + *(.gcc_except_table .gcc_except_table.*) + } + + .gnu_extab : ONLY_IF_RO { + *(.gnu_extab*) + } + + .exception_ranges : ONLY_IF_RO { + *(.exception_ranges*) + } + + PROVIDE(__etext = .); + PROVIDE(_etext = .); + PROVIDE(etext = .); + + . = ALIGN(0x4000); + . = DATA_SEGMENT_ALIGN(CONSTANT(MAXPAGESIZE), CONSTANT(COMMONPAGESIZE)); + + .eh_frame : ONLY_IF_RW { + KEEP(*(.eh_frame)) + *(.eh_frame.*) + } + + .gnu_extab : ONLY_IF_RW { + *(.gnu_extab) + } + + .gcc_except_table : ONLY_IF_RW { + *(.gcc_except_table .gcc_except_table.*) + } + + .exception_ranges : ONLY_IF_RW { + *(.exception_ranges*) + } + + .tdata : ONLY_IF_RW { + PROVIDE_HIDDEN(_tdata_start = .); + PROVIDE_HIDDEN(__tdata_start = .); + *(.tdata .tdata.* .gnu.linkonce.td.*) + PROVIDE_HIDDEN(_tdata_end = .); + } + + .tbss : { + PROVIDE_HIDDEN(_tbss_start = .); + *(.tbss .tbss.* .gnu.linkonce.tb.*) + *(.tcommon) + PROVIDE_HIDDEN(_tbss_end = .); + } + + .init_array : { + PROVIDE_HIDDEN(__init_array_start = .); + KEEP(*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) + KEEP(*(.init_array EXCLUDE_FILE(*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors)) + PROVIDE_HIDDEN(__init_array_end = .); + } + + .fini_array : { + PROVIDE_HIDDEN(__fini_array_start = .); + KEEP(*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*))) + KEEP(*(.fini_array EXCLUDE_FILE(*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors)) + PROVIDE_HIDDEN(__fini_array_end = .); + } + + .data.rel.ro : { + *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) + *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*) + } + + .dynamic : { + *(.dynamic) + } + + .got : { + *(.got) + *(.igot) + } + + . = DATA_SEGMENT_RELRO_END(24, .); + + .got.plt : { + *(.got.plt) + *(.igot.plt) + } + + .data : { + PROVIDE(__data_start = .); + *(.data .data.* .gnu.linkonce.d.*) + KEEP(*(SORT_BY_NAME(.sort.data.*))) + SORT(CONSTRUCTORS) + } + + _edata = .; + PROVIDE(edata = .); + + .data : { + KEEP(*(SORT_BY_NAME(.zip.*))) + HIDDEN(_ezip = .); + } + + . = .; + __bss_start = .; + __bss_start__ = .; + + .bss : { + *(.dynbss) + *(.bss .bss.* .gnu.linkonce.b.*) + KEEP(*(SORT_BY_NAME(.piro.bss.sort.*))) + *(COMMON) + } + + _bss_end__ = .; + __bss_end__ = .; + . = ALIGN(64 / 8); + . = SEGMENT_START("ldata-segment", .); + . = ALIGN(64 / 8); + __end__ = .; + _end = .; + PROVIDE(end = .); + + . = DATA_SEGMENT_END(.); + + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .gnu.build.attributes : { *(.gnu.build.attributes .gnu.build.attributes.*) } + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + .debug_pubtypes 0 : { *(.debug_pubtypes) } + .debug_ranges 0 : { *(.debug_ranges) } + .debug_macro 0 : { *(.debug_macro) } + .debug_addr 0 : { *(.debug_addr) } + .ARM.attributes 0 : { KEEP(*(.ARM.attributes)) KEEP(*(.gnu.attributes)) } + .note.gnu.arm.ident 0 : { KEEP(*(.note.gnu.arm.ident)) } + + /DISCARD/ : { + *(.GCC.command.line) + *(.note.GNU-stack) + *(.gnu_debuglink) + *(.text.windows) + *(.gnu.lto_*) + *(.idata.*) + *(.head) + } +} + +PROVIDE(ape_stack_memsz = DEFINED(ape_stack_memsz) ? ape_stack_memsz : STACKSIZE); +PROVIDE_HIDDEN(_tls_size = _tbss_end - _tdata_start); +PROVIDE_HIDDEN(_tdata_size = _tdata_end - _tdata_start); +PROVIDE_HIDDEN(_tbss_size = _tbss_end - _tbss_start); +PROVIDE_HIDDEN(_tbss_offset = _tbss_start - _tdata_start); +PROVIDE_HIDDEN(_tls_content = (_tdata_end - _tdata_start) + (_tbss_end - _tbss_start)); +PROVIDE_HIDDEN(__zip_start_rva = DEFINED(__zip_start) ? __zip_start - __executable_start : 0); + +/* ZIP End of Central Directory header */ +#define ZIPCONST(NAME, VAL) HIDDEN(NAME = DEFINED(__zip_start) ? VAL : 0); +ZIPCONST(v_zip_cdoffset, __zip_start - IMAGE_BASE_VIRTUAL); +ZIPCONST(v_zip_cdirsize, __zip_end - __zip_start); +ASSERT(v_zip_cdirsize % kZipCdirHdrLinkableSize == 0, "bad zip cdir"); +ZIPCONST(v_zip_records, v_zip_cdirsize / kZipCdirHdrLinkableSize); +ZIPCONST(v_zip_commentsize, _ezip - __zip_end - kZipCdirHdrMinSize); diff --git a/ape/ape-m1.c b/ape/ape-m1.c new file mode 100644 index 000000000..6d0e24664 --- /dev/null +++ b/ape/ape-m1.c @@ -0,0 +1,800 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Copyright 2021 Justine Alexandra Roberts Tunney │ +│ │ +│ Permission to use, copy, modify, and/or distribute this software for │ +│ any purpose with or without fee is hereby granted, provided that the │ +│ above copyright notice and this permission notice appear in all copies. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ +│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ +│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ +│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ +│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ +│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ +│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ +│ PERFORMANCE OF THIS SOFTWARE. │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define SYSLIB_MAGIC ('s' | 'l' << 8 | 'i' << 16 | 'b' << 24) +#define SYSLIB_VERSION 0 + +struct Syslib { + int magic; + int version; + void (*exit)(int) __attribute__((__noreturn__)); + long (*fork)(void); + long (*read)(int, void *, size_t); + long (*pread)(int, void *, size_t, off_t); + long (*readv)(int, const struct iovec *, int); + long (*write)(int, const void *, size_t); + long (*pwrite)(int, const void *, size_t, off_t); + long (*writev)(int, const struct iovec *, int); + long (*openat)(int, const char *, int, ...); + long (*pipe)(int[2]); + long (*close)(int); + long (*clock_gettime)(int, struct timespec *); + long (*nanosleep)(const struct timespec *, struct timespec *); + long (*mmap)(void *, size_t, int, int, int, off_t); + long (*sigaction)(int, const struct sigaction *restrict, struct sigaction *restrict); + int (*pthread_jit_write_protect_supported_np)(void); + void (*pthread_jit_write_protect_np)(int); + void (*sys_icache_invalidate)(void *, size_t); + pthread_t (*pthread_self)(void); + int (*pthread_create)(pthread_t *, const pthread_attr_t *, void *(*)(void *), void *); + int (*pthread_detach)(pthread_t); + int (*pthread_join)(pthread_t, void **); + void (*pthread_exit)(void *); + int (*pthread_kill)(pthread_t, int); + int (*pthread_sigmask)(int, const sigset_t *restrict, sigset_t *restrict); + int (*pthread_setname_np)(const char *); + int (*pthread_key_create)(pthread_key_t *, void (*)(void *)); + int (*pthread_setspecific)(pthread_key_t, const void *); + void *(*pthread_getspecific)(pthread_key_t); +}; + +#define TROUBLESHOOT 0 + +#define ELFCLASS64 2 +#define ELFDATA2LSB 1 +#define EM_AARCH64 183 +#define ET_EXEC 2 +#define PT_LOAD 1 +#define PT_DYNAMIC 2 +#define EI_CLASS 4 +#define EI_DATA 5 +#define PF_X 1 +#define PF_W 2 +#define PF_R 4 +#define AT_PHDR 3 +#define AT_PHENT 4 +#define AT_PHNUM 5 +#define AT_PAGESZ 6 +#define AT_BASE 7 +#define AT_ENTRY 9 +#define AT_UID 11 +#define AT_EUID 12 +#define AT_GID 13 +#define AT_EGID 14 +#define AT_HWCAP 16 +#define AT_HWCAP2 16 +#define AT_SECURE 23 +#define AT_RANDOM 25 +#define AT_EXECFN 31 + +#define STACK_ALIGN (sizeof(long) * 2) +#define AUXV_BYTES (sizeof(long) * 2 * 14) + +// from the xnu codebase +#define _COMM_PAGE_START_ADDRESS 0x0000000FFFFFC000ul +#define _COMM_PAGE_APRR_SUPPORT (_COMM_PAGE_START_ADDRESS + 0x10C) +#define _COMM_PAGE_APRR_WRITE_ENABLE (_COMM_PAGE_START_ADDRESS + 0x110) +#define _COMM_PAGE_APRR_WRITE_DISABLE (_COMM_PAGE_START_ADDRESS + 0x118) + +#define Min(X, Y) ((Y) > (X) ? (X) : (Y)) +#define Roundup(X, K) (((X) + (K) - 1) & -(K)) +#define Rounddown(X, K) ((X) & -(K)) + +#define Read32(S) \ + ((unsigned)(255 & (S)[3]) << 030 | \ + (unsigned)(255 & (S)[2]) << 020 | \ + (unsigned)(255 & (S)[1]) << 010 | \ + (unsigned)(255 & (S)[0]) << 000) + +#define Read64(S) \ + ((unsigned long)(255 & (S)[7]) << 070 | \ + (unsigned long)(255 & (S)[6]) << 060 | \ + (unsigned long)(255 & (S)[5]) << 050 | \ + (unsigned long)(255 & (S)[4]) << 040 | \ + (unsigned long)(255 & (S)[3]) << 030 | \ + (unsigned long)(255 & (S)[2]) << 020 | \ + (unsigned long)(255 & (S)[1]) << 010 | \ + (unsigned long)(255 & (S)[0]) << 000) + +struct PathSearcher { + unsigned long namelen; + const char *name; + const char *syspath; + char path[1024]; +}; + +struct ElfEhdr { + unsigned char e_ident[16]; + unsigned short e_type; + unsigned short e_machine; + unsigned e_version; + unsigned long e_entry; + unsigned long e_phoff; + unsigned long e_shoff; + unsigned e_flags; + unsigned short e_ehsize; + unsigned short e_phentsize; + unsigned short e_phnum; + unsigned short e_shentsize; + unsigned short e_shnum; + unsigned short e_shstrndx; +}; + +struct ElfPhdr { + unsigned p_type; + unsigned p_flags; + unsigned long p_offset; + unsigned long p_vaddr; + unsigned long p_paddr; + unsigned long p_filesz; + unsigned long p_memsz; + unsigned long p_align; +}; + +union ElfEhdrBuf { + struct ElfEhdr ehdr; + char buf[0x1000]; +}; + +union ElfPhdrBuf { + struct ElfPhdr phdr; + char buf[0x1000]; +}; + +static int ToLower(int c) { + return 'A' <= c && c <= 'Z' ? c + ('a' - 'A') : c; +} + +static void *MemSet(void *a, int c, unsigned long n) { + char *d = a; + unsigned long i; + for (i = 0; i < n; ++i) { + d[i] = c; + } + return d; +} + +static void *MemMove(void *a, const void *b, unsigned long n) { + char *d = a; + unsigned long i; + const char *s = b; + if (d > s) { + for (i = n; i--;) { + d[i] = s[i]; + } + } else { + for (i = 0; i < n; ++i) { + d[i] = s[i]; + } + } + return d; +} + +static unsigned long StrLen(const char *s) { + unsigned long n = 0; + while (*s++) ++n; + return n; +} + +static const char *MemChr(const char *s, unsigned char c, unsigned long n) { + for (; n; --n, ++s) { + if ((*s & 255) == c) { + return s; + } + } + return 0; +} + +static char *GetEnv(char **p, const char *s) { + unsigned long i, j; + if (p) { + for (i = 0; p[i]; ++i) { + for (j = 0;; ++j) { + if (!s[j]) { + if (p[i][j] == '=') { + return p[i] + j + 1; + } + break; + } + if (s[j] != p[i][j]) { + break; + } + } + } + } + return 0; +} + +static char *Utoa(char p[21], unsigned long x) { + char t; + unsigned long i, a, b; + i = 0; + do { + p[i++] = x % 10 + '0'; + x = x / 10; + } while (x > 0); + p[i] = '\0'; + if (i) { + for (a = 0, b = i - 1; a < b; ++a, --b) { + t = p[a]; + p[a] = p[b]; + p[b] = t; + } + } + return p + i; +} + +static char *Itoa(char p[21], long x) { + if (x < 0) *p++ = '-', x = -(unsigned long)x; + return Utoa(p, x); +} + +static void Emit(const char *s) { + write(2, s, StrLen(s)); +} + +static void Perror(const char *c, int failed, const char *s) { + char ibuf[21]; + Emit("ape error: "); + Emit(c); + Emit(": "); + Emit(s); + if (failed) { + Emit(" failed errno="); + Itoa(ibuf, errno); + Emit(ibuf); + } + Emit("\n"); +} + +__attribute__((__noreturn__)) +static void Pexit(const char *c, int failed, const char *s) { + Perror(c, failed, s); + _exit(127); +} + +static int StrCmp(const char *l, const char *r) { + unsigned long i = 0; + while (l[i] == r[i] && r[i]) ++i; + return (l[i] & 255) - (r[i] & 255); +} + +static char EndsWithIgnoreCase(const char *p, unsigned long n, const char *s) { + unsigned long i, m; + if (n >= (m = StrLen(s))) { + for (i = n - m; i < n; ++i) { + if (ToLower(p[i]) != *s++) { + return 0; + } + } + return 1; + } else { + return 0; + } +} + +static char IsComPath(struct PathSearcher *ps) { + return EndsWithIgnoreCase(ps->name, ps->namelen, ".com") || + EndsWithIgnoreCase(ps->name, ps->namelen, ".exe") || + EndsWithIgnoreCase(ps->name, ps->namelen, ".com.dbg"); +} + +static char AccessCommand(struct PathSearcher *ps, const char *suffix, + unsigned long pathlen) { + unsigned long suffixlen; + suffixlen = StrLen(suffix); + if (pathlen + 1 + ps->namelen + suffixlen + 1 > sizeof(ps->path)) return 0; + if (pathlen && ps->path[pathlen - 1] != '/') ps->path[pathlen++] = '/'; + MemMove(ps->path + pathlen, ps->name, ps->namelen); + MemMove(ps->path + pathlen + ps->namelen, suffix, suffixlen + 1); + return !access(ps->path, X_OK); +} + +static char SearchPath(struct PathSearcher *ps, const char *suffix) { + const char *p; + unsigned long i; + for (p = ps->syspath;;) { + for (i = 0; p[i] && p[i] != ':'; ++i) { + if (i < sizeof(ps->path)) { + ps->path[i] = p[i]; + } + } + if (AccessCommand(ps, suffix, i)) { + return 1; + } else if (p[i] == ':') { + p += i + 1; + } else { + return 0; + } + } +} + +static char FindCommand(struct PathSearcher *ps, const char *suffix) { + if (MemChr(ps->name, '/', ps->namelen) || + MemChr(ps->name, '\\', ps->namelen)) { + ps->path[0] = 0; + return AccessCommand(ps, suffix, 0); + } else { + if (AccessCommand(ps, suffix, 0)) return 1; + } + return SearchPath(ps, suffix); +} + +static char *Commandv(struct PathSearcher *ps, + const char *name, + const char *syspath) { + ps->syspath = syspath ? syspath : "/bin:/usr/local/bin:/usr/bin"; + if (!(ps->namelen = StrLen((ps->name = name)))) return 0; + if (ps->namelen + 1 > sizeof(ps->path)) return 0; + if (FindCommand(ps, "") || (!IsComPath(ps) && FindCommand(ps, ".com"))) { + return ps->path; + } else { + return 0; + } +} + +static void pthread_jit_write_protect_np_workaround(int enabled) { + int count_start = 8192; + volatile int count = count_start; + unsigned long *addr, *other, val, val2, reread = -1; + addr = (unsigned long *)(!enabled ? _COMM_PAGE_APRR_WRITE_ENABLE + : _COMM_PAGE_APRR_WRITE_DISABLE); + other = (unsigned long *)(enabled ? _COMM_PAGE_APRR_WRITE_ENABLE + : _COMM_PAGE_APRR_WRITE_DISABLE); + switch (*(volatile unsigned char *)_COMM_PAGE_APRR_SUPPORT) { + case 1: + do { + val = *addr; + reread = -1; + asm volatile("msr\tS3_4_c15_c2_7,%0\n" + "isb\tsy\n" + : /* no outputs */ + : "r"(val) + : "memory"); + val2 = *addr; + asm volatile("mrs\t%0,S3_4_c15_c2_7\n" + : "=r"(reread) + : /* no inputs */ + : "memory"); + if (val2 == reread) { + return; + } + usleep(10); + } while (count-- > 0); + break; + case 3: + do { + val = *addr; + reread = -1; + asm volatile("msr\tS3_6_c15_c1_5,%0\n" + "isb\tsy\n" + : /* no outputs */ + : "r"(val) + : "memory"); + val2 = *addr; + asm volatile("mrs\t%0,S3_6_c15_c1_5\n" + : "=r"(reread) + : /* no inputs */ + : "memory"); + if (val2 == reread) { + return; + } + usleep(10); + } while (count-- > 0); + break; + default: + pthread_jit_write_protect_np(enabled); + return; + } + Pexit("ape-m1", 0, "failed to set jit write protection"); +} + +__attribute__((__noreturn__)) +static void Spawn(const char *exe, + int fd, long *sp, + struct ElfEhdr *e, + struct ElfPhdr *p, + struct Syslib *lib) { + int prot, flags; + long code, codesize; + unsigned long a, b, i; + code = 0; + codesize = 0; + for (i = e->e_phnum; i--;) { + if (p[i].p_type == PT_DYNAMIC) { + Pexit(exe, 0, "not a real executable"); + } + if (p[i].p_type != PT_LOAD) { + continue; + } + if (!p[i].p_memsz) { + continue; + } + if (p[i].p_vaddr & 0x3fff) { + Pexit(exe, 0, "APE phdr addr must be 16384-aligned"); + } + if (p[i].p_offset & 0x3fff) { + Pexit(exe, 0, "APE phdr offset must be 16384-aligned"); + } + if ((p[i].p_flags & (PF_W | PF_X)) == (PF_W | PF_X)) { + Pexit(exe, 0, "Apple Silicon doesn't allow RWX memory"); + } + prot = 0; + flags = MAP_FIXED | MAP_PRIVATE; + if (p[i].p_flags & PF_R) { + prot |= PROT_READ; + } + if (p[i].p_flags & PF_W) { + prot |= PROT_WRITE; + } + if (p[i].p_flags & PF_X) { + prot |= PROT_EXEC; + code = p[i].p_vaddr; + codesize = p[i].p_filesz; + } + if (p[i].p_filesz) { + if (mmap((char *)p[i].p_vaddr, p[i].p_filesz, prot, + flags, fd, p[i].p_offset) == MAP_FAILED) { + Pexit(exe, -1, "image mmap()"); + } + if ((a = Min(-p[i].p_filesz & 0x3fff, p[i].p_memsz - p[i].p_filesz))) { + MemSet((void *)(p[i].p_vaddr + p[i].p_filesz), 0, a); + } + } + if ((b = Roundup(p[i].p_memsz, 0x4000)) > + (a = Roundup(p[i].p_filesz, 0x4000))) { + if (mmap((char *)p[i].p_vaddr + a, b - a, + prot, flags | MAP_ANONYMOUS, -1, 0) == MAP_FAILED) { + Pexit(exe, -1, "bss mmap()"); + } + } + } + if (!code) { + Pexit(exe, 0, "ELF needs PT_LOAD phdr w/ PF_X"); + } + + close(fd); + + register long *x0 asm("x0") = sp; + register struct Syslib *x15 asm("x15") = lib; + register long x16 asm("x16") = e->e_entry; + asm volatile("mov\tx1,#0\n\t" + "mov\tx2,#0\n\t" + "mov\tx3,#0\n\t" + "mov\tx4,#0\n\t" + "mov\tx5,#0\n\t" + "mov\tx6,#0\n\t" + "mov\tx7,#0\n\t" + "mov\tx8,#0\n\t" + "mov\tx9,#0\n\t" + "mov\tx10,#0\n\t" + "mov\tx11,#0\n\t" + "mov\tx12,#0\n\t" + "mov\tx13,#0\n\t" + "mov\tx14,#0\n\t" + "mov\tx17,#0\n\t" + "mov\tx19,#0\n\t" + "mov\tx20,#0\n\t" + "mov\tx21,#0\n\t" + "mov\tx22,#0\n\t" + "mov\tx23,#0\n\t" + "mov\tx24,#0\n\t" + "mov\tx25,#0\n\t" + "mov\tx26,#0\n\t" + "mov\tx27,#0\n\t" + "mov\tx28,#0\n\t" + "mov\tx29,#0\n\t" + "mov\tx30,#0\n\t" + "mov\tsp,x0\n\t" + "mov\tx0,#0\n\t" + "br\tx16" + : /* no outputs */ + : "r"(x0), "r"(x15), "r"(x16) + : "memory"); + __builtin_unreachable(); +} + +static void TryElf(const char *exe, int fd, long *sp, long *bp, char *execfn, + union ElfEhdrBuf *ehdr, union ElfPhdrBuf *phdr, struct Syslib *lib) { + unsigned long n; + if (Read32(ehdr->buf) == Read32("\177ELF") && + ehdr->ehdr.e_type == ET_EXEC && + ehdr->ehdr.e_machine == EM_AARCH64 && + ehdr->ehdr.e_ident[EI_CLASS] == ELFCLASS64 && + ehdr->ehdr.e_ident[EI_DATA] == ELFDATA2LSB && + (n = ehdr->ehdr.e_phnum * sizeof(phdr->phdr)) <= sizeof(phdr->buf) && + pread(fd, phdr->buf, n, ehdr->ehdr.e_phoff) == n) { + long auxv[][2] = { + {AT_PHDR, (long)&phdr->phdr}, // + {AT_PHENT, ehdr->ehdr.e_phentsize}, // + {AT_PHNUM, ehdr->ehdr.e_phnum}, // + {AT_ENTRY, ehdr->ehdr.e_entry}, // + {AT_PAGESZ, 0x4000}, // + {AT_UID, getuid()}, // + {AT_EUID, geteuid()}, // + {AT_GID, getgid()}, // + {AT_EGID, getegid()}, // + {AT_HWCAP, 0xffb3ffffu}, // + {AT_HWCAP2, 0x181}, // + {AT_SECURE, issetugid()}, // + {AT_EXECFN, (long)execfn}, // + {0, 0}, // + }; + _Static_assert(sizeof(auxv) == AUXV_BYTES, + "Please update the AUXV_BYTES constant"); + MemMove(bp, auxv, sizeof(auxv)); + Spawn(exe, fd, sp, &ehdr->ehdr, &phdr->phdr, lib); + } +} + +__attribute__((__noinline__)) +static long sysret(long rc) { + return rc == -1 ? -errno : rc; +} + +static long sys_fork(void) { + return sysret(fork()); +} + +static long sys_read(int fd, void *p, size_t n) { + return sysret(read(fd, p, n)); +} + +static long sys_pread(int fd, void *p, size_t n, off_t o) { + return sysret(pread(fd, p, n, o)); +} + +static long sys_readv(int fd, const struct iovec *p, int n) { + return sysret(readv(fd, p, n)); +} + +static long sys_write(int fd, const void *p, size_t n) { + return sysret(write(fd, p, n)); +} + +static long sys_pwrite(int fd, const void *p, size_t n, off_t o) { + return sysret(pwrite(fd, p, n, o)); +} + +static long sys_writev(int fd, const struct iovec *p, int n) { + return sysret(writev(fd, p, n)); +} + +static long sys_openat(int dirfd, const char *path, int oflag, ...) { + va_list va; + unsigned mode; + va_start(va, oflag); + mode = va_arg(va, unsigned); + va_end(va); + return sysret(openat(dirfd, path, oflag, mode)); +} + +static long sys_pipe(int pfds[2]) { + return sysret(pipe(pfds)); +} + +static long sys_close(int fd) { + return sysret(close(fd)); +} + +static long sys_clock_gettime(int clock, struct timespec *ts) { + return sysret(clock_gettime(clock, ts)); +} + +static long sys_nanosleep(const struct timespec *req, struct timespec *rem) { + return sysret(nanosleep(req, rem)); +} + +static long sys_mmap(void *addr, size_t size, int prot, int flags, int fd, off_t off) { + return sysret((long)mmap(addr, size, prot, flags, fd, off)); +} + +static long sys_sigaction(int sig, const struct sigaction *restrict act, + struct sigaction *restrict oact) { + return sysret(sigaction(sig, act, oact)); +} + +int loader(int argc, char **argv, char **envp) { + long *sp, *bp, *ip; + int c, i, n, fd, rc; + char *p, *tp, *exe, *prog, *execfn; + + struct { + union ElfEhdrBuf ehdr; + struct PathSearcher ps; + // this memory shall be discarded by the guest + ////////////////////////////////////////////// + // this memory shall be known to guest program + union { + char argblock[ARG_MAX]; + long numblock[ARG_MAX / sizeof(long)]; + }; + union ElfPhdrBuf phdr; + struct Syslib lib; + } M; + + // expose some apple libraries + M.lib.magic = SYSLIB_MAGIC; + M.lib.version = SYSLIB_VERSION; + M.lib.exit = _exit; + M.lib.fork = sys_fork; + M.lib.read = sys_read; + M.lib.pread = sys_pread; + M.lib.readv = sys_readv; + M.lib.write = sys_write; + M.lib.pwrite = sys_pwrite; + M.lib.writev = sys_writev; + M.lib.openat = sys_openat; + M.lib.close = sys_close; + M.lib.clock_gettime = sys_clock_gettime; + M.lib.nanosleep = sys_nanosleep; + M.lib.mmap = sys_mmap; + M.lib.sigaction = sys_sigaction; + M.lib.pthread_jit_write_protect_supported_np = + pthread_jit_write_protect_supported_np; + M.lib.pthread_jit_write_protect_np = + pthread_jit_write_protect_np_workaround; + M.lib.pthread_self = pthread_self; + M.lib.pthread_create = pthread_create; + M.lib.pthread_join = pthread_join; + M.lib.pthread_exit = pthread_exit; + M.lib.pthread_kill = pthread_kill; + M.lib.pthread_sigmask = pthread_sigmask; + M.lib.pthread_setname_np = pthread_setname_np; + M.lib.pthread_key_create = pthread_key_create; + M.lib.pthread_getspecific = pthread_getspecific; + M.lib.pthread_setspecific = pthread_setspecific; + + // copy system provided argument block + bp = M.numblock; + tp = M.argblock + sizeof(M.argblock); + *bp++ = argc; + for (i = 0; i < argc; ++i) { + tp -= (n = StrLen(argv[i]) + 1); + MemMove(tp, argv[i], n); + *bp++ = (long)tp; + } + *bp++ = 0; + for (i = 0; envp[i]; ++i) { + tp -= (n = StrLen(envp[i]) + 1); + MemMove(tp, envp[i], n); + *bp++ = (long)tp; + } + *bp++ = 0; + + // get arguments that point into our block + sp = M.numblock; + argc = *sp; + argv = (char **)(sp + 1); + envp = (char **)(sp + 1 + argc + 1); + + // xnu stores getauxval(at_execfn) in getenv("_") + execfn = argc > 0 ? argv[0] : 0; + for (i = 0; envp[i]; ++i) { + if (envp[i][0] == '_' && envp[i][1] == '=') { + execfn = envp[i] + 2; + break; + } + } + + // interpret command line arguments + if (argc >= 3 && !StrCmp(argv[1], "-")) { + // if the first argument is a hyphen then we give the user the + // power to change argv[0] or omit it entirely. most operating + // systems don't permit the omission of argv[0] but we do, b/c + // it's specified by ANSI X3.159-1988. + prog = (char *)sp[3]; + argc = sp[3] = sp[0] - 3; + argv = (char **)((sp += 3) + 1); + } else if (argc < 2) { + Emit("usage: ape-m1 PROG [ARGV1,ARGV2,...]\n" + " ape-m1 - PROG [ARGV0,ARGV1,...]\n" + "actually portable executable loader (apple arm)\n" + "copyright 2023 justine alexandra roberts tunney\n" + "https://justine.lol/ape.html\n"); + _exit(1); + } else { + prog = (char *)sp[2]; + argc = sp[1] = sp[0] - 1; + argv = (char **)((sp += 1) + 1); + } + + // squeeze and align the argument block + ip = (long *)(((long)tp - AUXV_BYTES) & -sizeof(long)); + ip -= (n = bp - sp); + ip = (long *)((long)ip & -STACK_ALIGN); + MemMove(ip, sp, n * sizeof(long)); + bp = ip + n; + sp = ip; + + // search for executable + if (!(exe = Commandv(&M.ps, prog, GetEnv(envp, "PATH")))) { + Pexit(prog, 0, "not found (maybe chmod +x)"); + } else if ((fd = openat(AT_FDCWD, exe, O_RDONLY)) < 0) { + Pexit(exe, -1, "open"); + } else if ((rc = read(fd, M.ehdr.buf, sizeof(M.ehdr.buf))) < 0) { + Pexit(exe, -1, "read"); + } else if (rc != sizeof(M.ehdr.buf)) { + Pexit(exe, 0, "too small"); + } + +#if TROUBLESHOOT + for (i = 0; i < argc; ++i) { + Emit("argv = "); + Emit(argv[i]); + Emit("\n"); + } +#endif + + // ape intended behavior + // 1. if file is an elf executable, it'll be used as-is + // 2. if ape, will scan shell script for elf printf statements + // 3. shell script may have multiple lines producing elf headers + // 4. all elf printf lines must exist in the first 4096 bytes of file + // 5. elf program headers may appear anywhere in the binary + if (Read64(M.ehdr.buf) == Read64("MZqFpD='") || + Read64(M.ehdr.buf) == Read64("jartsr='")) { + for (p = M.ehdr.buf; p < M.ehdr.buf + sizeof(M.ehdr.buf); ++p) { + if (Read64(p) != Read64("printf '")) { + continue; + } + for (i = 0, p += 8; p + 3 < M.ehdr.buf + sizeof(M.ehdr.buf) && (c = *p++) != '\'';) { + if (c == '\\') { + if ('0' <= *p && *p <= '7') { + c = *p++ - '0'; + if ('0' <= *p && *p <= '7') { + c *= 8; + c += *p++ - '0'; + if ('0' <= *p && *p <= '7') { + c *= 8; + c += *p++ - '0'; + } + } + } + } + M.ehdr.buf[i++] = c; + } + if (i >= sizeof(M.ehdr.ehdr)) { + TryElf(exe, fd, sp, bp, execfn, &M.ehdr, &M.phdr, &M.lib); + } + } + } + TryElf(exe, fd, sp, bp, execfn, &M.ehdr, &M.phdr, &M.lib); + Pexit(exe, 0, "Not an acceptable APE/ELF executable for AARCH64"); +} + +asm(".globl\t_main\n_main:\t" + "stp\tx29,x30,[sp,#-16]!\n\t" + "mov\tx29,sp\n\t" + "mov\tx9,sp\n\t" + "and\tsp,x9,#-(2*1024*1024)\n\t" + "bl\t_loader\n\t" + "ldp\tx29,x30,[sp],#16\n\t" + "ret"); diff --git a/ape/ape.lds b/ape/ape.lds index 770a668d4..dc2b5c58e 100644 --- a/ape/ape.lds +++ b/ape/ape.lds @@ -199,9 +199,8 @@ #define SKEW 0 #endif -#ifdef __aarch64__ -#undef PAGESIZE -#define PAGESIZE 16384 +#if IMAGE_BASE_VIRTUAL > 0xffffffff +#error "please use 32-bit addresses for image data" #endif ENTRY(_start) @@ -223,7 +222,7 @@ SECTIONS { /*BEGIN: bsd addressability guarantee */ .head SEGMENT_START("text-segment", IMAGE_BASE_VIRTUAL) + SKEW : AT(IMAGE_BASE_REAL) { - HIDDEN(_base = .); + HIDDEN(__executable_start = .); /* Real Mode */ KEEP(*(.head)) @@ -650,6 +649,7 @@ TSSDESCSTUB2(_tss, _tss, _tss_end ? _tss_end - _tss - 1 : 0); /* ZIP End of Central Directory header */ #define ZIPCONST(NAME, VAL) HIDDEN(NAME = DEFINED(__zip_start) ? VAL : 0); ZIPCONST(v_zip_cdoffset, __zip_start - IMAGE_BASE_VIRTUAL); +ZIPCONST(v_zip_cdoffset, __zip_start - IMAGE_BASE_VIRTUAL); ZIPCONST(v_zip_cdirsize, __zip_end - __zip_start); ASSERT(v_zip_cdirsize % kZipCdirHdrLinkableSize == 0, "bad zip cdir"); ZIPCONST(v_zip_records, v_zip_cdirsize / kZipCdirHdrLinkableSize); diff --git a/ape/ape.mk b/ape/ape.mk index 859f7e3a0..09d586fcb 100644 --- a/ape/ape.mk +++ b/ape/ape.mk @@ -19,8 +19,9 @@ APE_FILES := $(wildcard ape/*.*) APE_HDRS = $(filter %.h,$(APE_FILES)) APE_INCS = $(filter %.inc,$(APE_FILES)) -APE = o/$(MODE)/ape/ape.o \ - o/$(MODE)/ape/ape.lds +ifeq ($(ARCH), aarch64) + +APE = o/$(MODE)/ape/aarch64.lds APELINK = \ $(COMPILE) \ @@ -29,8 +30,6 @@ APELINK = \ $(LINKARGS) \ $(OUTPUT_OPTION) -ifeq ($(ARCH), aarch64) - APE_SRCS = ape/ape.S APE_OBJS = o/$(MODE)/ape/ape.o APE_NO_MODIFY_SELF = $(APE) @@ -39,8 +38,26 @@ APE_COPY_SELF = $(APE) .PHONY: o/$(MODE)/ape o/$(MODE)/ape: $(APE) +o/$(MODE)/ape/aarch64.lds: \ + ape/aarch64.lds \ + libc/zip.h \ + libc/intrin/bits.h \ + libc/calls/struct/timespec.h \ + libc/macros.internal.h \ + libc/str/str.h + else +APE = o/$(MODE)/ape/ape.o \ + o/$(MODE)/ape/ape.lds + +APELINK = \ + $(COMPILE) \ + -ALINK.ape \ + $(LINK) \ + $(LINKARGS) \ + $(OUTPUT_OPTION) + APE_NO_MODIFY_SELF = \ o/$(MODE)/ape/ape.lds \ o/$(MODE)/ape/ape-no-modify-self.o diff --git a/ape/loader.c b/ape/loader.c index d71b02d35..44d4550c4 100644 --- a/ape/loader.c +++ b/ape/loader.c @@ -180,10 +180,13 @@ struct ElfPhdr { extern char ehdr[]; extern char _end[]; static void *syscall_; -static char relocated; static struct PathSearcher ps; extern char __syscall_loader[]; +#if SET_EXE_FILE +static char relocated; +#endif + static int ToLower(int c) { return 'A' <= c && c <= 'Z' ? c + ('a' - 'A') : c; } diff --git a/ape/sections.internal.h b/ape/sections.internal.h index 8852f8dd1..7e72a3553 100644 --- a/ape/sections.internal.h +++ b/ape/sections.internal.h @@ -3,31 +3,31 @@ #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ -extern unsigned char _base[]; -extern unsigned char _ehead[]; -extern unsigned char _etext[]; -extern unsigned char _edata[]; -extern unsigned char _ezip[]; -extern unsigned char _end[]; -extern unsigned char _ereal[]; -extern unsigned char _tdata_start[]; -extern unsigned char _tdata_end[]; -extern unsigned char _tbss_start[]; -extern unsigned char _tbss_end[]; -extern unsigned char __privileged_start[]; -extern unsigned char __privileged_addr[]; -extern unsigned char __privileged_size[]; -extern unsigned char __privileged_end[]; -extern unsigned char __test_start[]; -extern unsigned char __ro[]; -extern unsigned char *__relo_start[]; -extern unsigned char *__relo_end[]; -extern uint8_t __zip_start[]; -extern uint8_t __zip_end[]; -extern uint8_t __data_start[]; -extern uint8_t __data_end[]; -extern uint8_t __bss_start[]; -extern uint8_t __bss_end[]; +extern unsigned char __executable_start[] __attribute__((__weak__)); +extern unsigned char _ehead[] __attribute__((__weak__)); +extern unsigned char _etext[] __attribute__((__weak__)); +extern unsigned char _edata[] __attribute__((__weak__)); +extern unsigned char _ezip[] __attribute__((__weak__)); +extern unsigned char _end[] __attribute__((__weak__)); +extern unsigned char _ereal[] __attribute__((__weak__)); +extern unsigned char _tdata_start[] __attribute__((__weak__)); +extern unsigned char _tdata_end[] __attribute__((__weak__)); +extern unsigned char _tbss_start[] __attribute__((__weak__)); +extern unsigned char _tbss_end[] __attribute__((__weak__)); +extern unsigned char __privileged_start[] __attribute__((__weak__)); +extern unsigned char __privileged_addr[] __attribute__((__weak__)); +extern unsigned char __privileged_size[] __attribute__((__weak__)); +extern unsigned char __privileged_end[] __attribute__((__weak__)); +extern unsigned char __test_start[] __attribute__((__weak__)); +extern unsigned char __ro[] __attribute__((__weak__)); +extern unsigned char *__relo_start[] __attribute__((__weak__)); +extern unsigned char *__relo_end[] __attribute__((__weak__)); +extern uint8_t __zip_start[] __attribute__((__weak__)); +extern uint8_t __zip_end[] __attribute__((__weak__)); +extern uint8_t __data_start[] __attribute__((__weak__)); +extern uint8_t __data_end[] __attribute__((__weak__)); +extern uint8_t __bss_start[] __attribute__((__weak__)); +extern uint8_t __bss_end[] __attribute__((__weak__)); COSMOPOLITAN_C_END_ #endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */ diff --git a/build/bootstrap/fixupobj.com b/build/bootstrap/fixupobj.com index 28bc765a2..59f944cc1 100755 Binary files a/build/bootstrap/fixupobj.com and b/build/bootstrap/fixupobj.com differ diff --git a/build/config.mk b/build/config.mk index fcee06d5f..64c731b4a 100644 --- a/build/config.mk +++ b/build/config.mk @@ -192,6 +192,7 @@ PYFLAGS += \ endif ifeq ($(MODE), aarch64-tiny) +# TODO(jart): -mcmodel=tiny CONFIG_CPPFLAGS += \ -DTINY \ -DNDEBUG \ @@ -203,7 +204,7 @@ CONFIG_CCFLAGS += \ -fno-align-labels \ -fno-align-loops \ -fschedule-insns2 \ - -fomit-frame-pointer \ + -fno-omit-frame-pointer \ -momit-leaf-frame-pointer \ -foptimize-sibling-calls \ -DDWARFLESS diff --git a/build/definitions.mk b/build/definitions.mk index b2473ff17..630b52abd 100644 --- a/build/definitions.mk +++ b/build/definitions.mk @@ -68,7 +68,6 @@ COMPILE = build/bootstrap/compile.com -V9 -P4096 $(QUOTA) COMMA := , PWD := $(shell build/bootstrap/pwd.com) -IMAGE_BASE_VIRTUAL ?= 0x400000 IGNORE := $(shell $(ECHO) -2 ♥cosmo) IGNORE := $(shell $(MKDIR) o/tmp) @@ -126,6 +125,12 @@ ifneq ($(ARCH), aarch64) MNO_FENTRY = -mno-fentry endif +ifeq ($(ARCH), aarch64) +IMAGE_BASE_VIRTUAL ?= 0x010000000000 +else +IMAGE_BASE_VIRTUAL ?= 0x400000 +endif + FTRACE = \ -pg @@ -169,7 +174,6 @@ DEFAULT_OFLAGS = \ DEFAULT_COPTS = \ -fno-math-errno \ - -fno-fp-int-builtin-inexact \ -fno-ident \ -fno-common \ -fno-gnu-unique \ @@ -177,12 +181,25 @@ DEFAULT_COPTS = \ -fstrict-overflow \ -fno-semantic-interposition -ifneq ($(ARCH), aarch64) +ifeq ($(ARCH), x86_64) DEFAULT_COPTS += \ -mno-red-zone \ -mno-tls-direct-seg-refs endif +ifeq ($(ARCH), aarch64) +# +# - Apple says in "Writing ARM64 code for Apple platforms" that we're +# not allowed to use the x18 register. +# +# - Cosmopolitan Libc uses x28 for thread-local storage because Apple +# forbids us from using tpidr_el0 too. +# +DEFAULT_COPTS += \ + -ffixed-x18 \ + -ffixed-x28 +endif + MATHEMATICAL = \ -O3 \ -fwrapv @@ -217,8 +234,18 @@ DEFAULT_LDFLAGS = \ -nostdlib \ --gc-sections \ --build-id=none \ - --no-dynamic-linker \ - -zmax-page-size=0x1000 #--cref -Map=$@.map + --no-dynamic-linker #--cref -Map=$@.map + +ifeq ($(ARCH), aarch64) +DEFAULT_LDFLAGS += \ + -zmax-page-size=0x4000 \ + -zcommon-page-size=0x4000 \ + -znorelro +else +DEFAULT_LDFLAGS += \ + -zmax-page-size=0x1000 \ + -zcommon-page-size=0x1000 +endif ZIPOBJ_FLAGS = \ -b$(IMAGE_BASE_VIRTUAL) diff --git a/build/rules.mk b/build/rules.mk index ce717c847..1baa37a52 100644 --- a/build/rules.mk +++ b/build/rules.mk @@ -16,18 +16,21 @@ MAKEFLAGS += --no-builtin-rules +ifneq ($(ARCH), aarch64) +MAKE_OBJCOPY = $(COMPILE) -AOBJCOPY -T$@ $(OBJCOPY) -S -O binary $< $@ +else +MAKE_OBJCOPY = $(COMPILE) -AOBJCOPY -T$@ $(OBJCOPY) -S $< $@ +endif + o/%.lds: %.lds ; @$(COMPILE) -APREPROCESS $(PREPROCESS.lds) $(OUTPUT_OPTION) $< o/%.inc: %.h ; @$(COMPILE) -APREPROCESS $(PREPROCESS) $(OUTPUT_OPTION) -D__ASSEMBLER__ -P $< -o/%.greg.o: %.greg.c ; @$(COMPILE) -AOBJECTIFY.greg $(OBJECTIFY.greg.c) $(OUTPUT_OPTION) $< -o/$(MODE)/%: o/$(MODE)/%.dbg ; @$(COMPILE) -AOBJCOPY -T$@ $(OBJCOPY) -S -O binary $< $@ +o/$(MODE)/%: o/$(MODE)/%.dbg ; @$(MAKE_OBJCOPY) o/$(MODE)/%.o: %.f ; @$(COMPILE) -AOBJECTIFY.f $(OBJECTIFY.f) $(OUTPUT_OPTION) $< o/$(MODE)/%.o: %.F ; @$(COMPILE) -AOBJECTIFY.F $(OBJECTIFY.F) $(OUTPUT_OPTION) $< o/$(MODE)/%.h: %.c ; @$(COMPILE) -AAMALGAMATE $(PREPROCESS) $(OUTPUT_OPTION) -fdirectives-only -P $< o/$(MODE)/%.h: o/$(MODE)/%.c ; @$(COMPILE) -AAMALGAMATE $(PREPROCESS) $(OUTPUT_OPTION) -fdirectives-only -P $< o/$(MODE)/%.o: %.cc ; @$(COMPILE) -AOBJECTIFY.cxx $(OBJECTIFY.cxx) $(OUTPUT_OPTION) $< o/$(MODE)/%.lds: %.lds ; @$(COMPILE) -APREPROCESS $(PREPROCESS.lds) $(OUTPUT_OPTION) $< -o/$(MODE)/%.o: %.greg.c ; @$(COMPILE) -AOBJECTIFY.greg $(OBJECTIFY.greg.c) $(OUTPUT_OPTION) $< -o/$(MODE)/%.greg.o: %.greg.c ; @$(COMPILE) -AOBJECTIFY.greg $(OBJECTIFY.greg.c) $(OUTPUT_OPTION) $< o/$(MODE)/%.initabi.o: %.initabi.c ; @$(COMPILE) -AOBJECTIFY.init $(OBJECTIFY.initabi.c) $(OUTPUT_OPTION) $< o/$(MODE)/%.ncabi.o: %.ncabi.c ; @$(COMPILE) -AOBJECTIFY.nc $(OBJECTIFY.ncabi.c) $(OUTPUT_OPTION) $< o/$(MODE)/%.real.o: %.c ; @$(COMPILE) -AOBJECTIFY.real $(OBJECTIFY.real.c) $(OUTPUT_OPTION) $< @@ -76,6 +79,18 @@ o/$(MODE)/%.o: o/$(MODE)/%.cc @$(COMPILE) -AOBJECTIFY.cxx $(OBJECTIFY.cxx) $(OUTPUT_OPTION) $< @$(COMPILE) -AFIXUPOBJ -wT$@ $(FIXUPOBJ) $@ +o/%.greg.o: %.greg.c + @$(COMPILE) -AOBJECTIFY.greg $(OBJECTIFY.greg.c) $(OUTPUT_OPTION) $< + @$(COMPILE) -AFIXUPOBJ -wT$@ $(FIXUPOBJ) $@ + +o/$(MODE)/%.o: %.greg.c + @$(COMPILE) -AOBJECTIFY.greg $(OBJECTIFY.greg.c) $(OUTPUT_OPTION) $< + @$(COMPILE) -AFIXUPOBJ -wT$@ $(FIXUPOBJ) $@ + +o/$(MODE)/%.greg.o: %.greg.c + @$(COMPILE) -AOBJECTIFY.greg $(OBJECTIFY.greg.c) $(OUTPUT_OPTION) $< + @$(COMPILE) -AFIXUPOBJ -wT$@ $(FIXUPOBJ) $@ + o/%.a: $(file >$(TMPDIR)/$(subst /,_,$@),$^) @$(COMPILE) -AARCHIVE -wT$@ $(AR) $(ARFLAGS) $@ @$(TMPDIR)/$(subst /,_,$@) @@ -199,10 +214,6 @@ o/$(MODE)/%.okk: % ################################################################################ # EXECUTABLE HELPERS -MAKE_OBJCOPY = \ - $(COMPILE) -AOBJCOPY -T$@ \ - $(OBJCOPY) -S -O binary $< $@ - MAKE_SYMTAB_CREATE = \ $(COMPILE) -wASYMTAB \ $(VM) \ diff --git a/examples/getrandom.c b/examples/getrandom.c index dd9aaa83f..6a9f09207 100644 --- a/examples/getrandom.c +++ b/examples/getrandom.c @@ -77,8 +77,8 @@ uint64_t unixv7(void) { uint64_t ape(void) { static int i; - if ((i += 8) > _end - _base) i = 8; - return READ64LE(_base + i); + if ((i += 8) > _end - __executable_start) i = 8; + return READ64LE(__executable_start + i); } uint64_t moby(void) { diff --git a/examples/nomodifyself.c b/examples/nomodifyself.c index 9b5553f31..ec29cc8ae 100644 --- a/examples/nomodifyself.c +++ b/examples/nomodifyself.c @@ -20,7 +20,7 @@ */ int main(int argc, char *argv[]) { - if (_base[0] == 'M' && _base[1] == 'Z') { + if (__executable_start[0] == 'M' && __executable_start[1] == 'Z') { printf("success: %s spawned without needing to modify its " "executable header", argv[0]); diff --git a/libc/assert.h b/libc/assert.h index 8bbb05f95..4cc3104f1 100644 --- a/libc/assert.h +++ b/libc/assert.h @@ -16,52 +16,18 @@ void __assert_fail(const char *, const char *, int) _Hide relegated; #define static_assert _Static_assert #endif -#ifdef __GNUC__ -#if !defined(TINY) && !defined(MODE_DBG) -/** - * Specifies expression can't possibly be false. - * - * This macro uses the `notpossible` keyword and is intended for things - * like systems integration, where we know for a fact that something is - * never going to happen, but there's no proof. So we don't want to add - * extra bloat for filenames and line numbers, since `ShowCrashReports` - * can print a backtrace if we just embed the UD2 instruction to crash. - * That's useful for systems code, for the following reason. Invariants - * make sense with _unassert() since they usually get placed at the top - * of functions. But if you used _unassert() to test a system call does - * not fail, then check happens at the end of your function usually and - * is therefore likely to result in a failure condition where execution - * falls through into a different function, which is shocking to debug. - * - * In `MODE=tiny` these assertions are redefined as undefined behavior. - */ -#define _npassert(x) \ - ({ \ - if (__builtin_expect(!(x), 0)) { \ - notpossible; \ - } \ - (void)0; \ +#ifndef NDEBUG +#define _unassert(x) __assert_macro(x, #x) +#define _npassert(x) __assert_macro(x, #x) +#define __assert_macro(x, s) \ + ({ \ + if (__builtin_expect(!(x), 0)) { \ + __assert_fail(s, __FILE__, __LINE__); \ + notpossible; \ + } \ + (void)0; \ }) #else -#define _npassert(x) _unassert(x) -#endif -#endif - -#ifdef __GNUC__ -/** - * Specifies expression being false is undefined behavior. - * - * This is a good way to tell the compiler about your invariants, which - * leads to smaller faster programs. The expression is never removed by - * the preprocessor so it's recommended that it be free of side-effects - * if you intend for it to be removed. At the same time, this guarantee - * makes this assertion useful for things like system calls, since they - * won't be removed by `NDEBUG` mode. - * - * If this assertion fails, the worst possible things can happen unless - * you've built your binary in `MODE=dbg` since UBSAN is the only thing - * that's capable of debugging this macro. - */ #define _unassert(x) \ ({ \ if (__builtin_expect(!(x), 0)) { \ @@ -69,6 +35,16 @@ void __assert_fail(const char *, const char *, int) _Hide relegated; } \ (void)0; \ }) +#define _npassert(x) \ + ({ \ + if (__builtin_expect(!(x), 0)) { \ + notpossible; \ + } \ + (void)0; \ + }) +#endif + +#ifdef __GNUC__ #endif COSMOPOLITAN_C_END_ diff --git a/libc/calls/__sig2.c b/libc/calls/__sig2.c index bbc49571f..2085d09c3 100644 --- a/libc/calls/__sig2.c +++ b/libc/calls/__sig2.c @@ -134,7 +134,7 @@ static bool __sig_deliver(bool restartable, int sig, int si_code, } // handover control to user - ((sigaction_f)(_base + rva))(sig, infop, ctx); + ((sigaction_f)(__executable_start + rva))(sig, infop, ctx); if ((~flags & SA_NODEFER) && (~flags & SA_RESETHAND)) { // it's now safe to reenter the signal so we need to restore it. diff --git a/libc/calls/calls.mk b/libc/calls/calls.mk index 2473ca709..9b14a8c1e 100644 --- a/libc/calls/calls.mk +++ b/libc/calls/calls.mk @@ -188,6 +188,10 @@ o/$(MODE)/libc/calls/unveil.o: private \ OVERRIDE_CFLAGS += \ -DSTACK_FRAME_UNLIMITED +ifeq ($(ARCH), aarch64) +o/$(MODE)/libc/calls/sigaction.o: private OVERRIDE_CFLAGS += -mcmodel=large +endif + # we want -Os because: # it makes a big difference # we need pic because: diff --git a/libc/calls/err.c b/libc/calls/err.c new file mode 100644 index 000000000..36498a3be --- /dev/null +++ b/libc/calls/err.c @@ -0,0 +1,26 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Copyright 2023 Justine Alexandra Roberts Tunney │ +│ │ +│ Permission to use, copy, modify, and/or distribute this software for │ +│ any purpose with or without fee is hereby granted, provided that the │ +│ above copyright notice and this permission notice appear in all copies. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ +│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ +│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ +│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ +│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ +│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ +│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ +│ PERFORMANCE OF THIS SOFTWARE. │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/calls/calls.h" +#include "libc/errno.h" + +extern _Thread_local int hog; + +int dog(void) { + return hog; +} diff --git a/libc/calls/execve.c b/libc/calls/execve.c index 7c0706a53..a4beeeb85 100644 --- a/libc/calls/execve.c +++ b/libc/calls/execve.c @@ -24,7 +24,6 @@ #include "libc/dce.h" #include "libc/intrin/asan.internal.h" #include "libc/intrin/describeflags.internal.h" -#include "libc/intrin/kprintf.h" #include "libc/intrin/likely.h" #include "libc/intrin/promises.internal.h" #include "libc/intrin/strace.internal.h" diff --git a/libc/calls/metalfile.c b/libc/calls/metalfile.c index 63aa205f8..0b3dbfcaa 100644 --- a/libc/calls/metalfile.c +++ b/libc/calls/metalfile.c @@ -63,7 +63,7 @@ textstartup noasan void InitializeMetalFile(void) { * The zipos code will automatically arrange to do this. Alternatively, * user code can STATIC_YOINK this symbol. */ - size_t size = ROUNDUP(_ezip - _base, 4096); + size_t size = ROUNDUP(_ezip - __executable_start, 4096); void *copied_base; struct DirectMap dm; dm = sys_mmap_metal(NULL, size, PROT_READ | PROT_WRITE, diff --git a/libc/calls/sigaction.c b/libc/calls/sigaction.c index 9f3ae0272..33b8f2acf 100644 --- a/libc/calls/sigaction.c +++ b/libc/calls/sigaction.c @@ -17,6 +17,7 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/struct/sigaction.h" +#include "ape/sections.internal.h" #include "libc/assert.h" #include "libc/calls/blocksigs.internal.h" #include "libc/calls/calls.h" @@ -168,9 +169,11 @@ static int __sigaction(int sig, const struct sigaction *act, rva = (int32_t)(intptr_t)SIG_DFL; } else if ((intptr_t)act->sa_handler < kSigactionMinRva) { rva = (int)(intptr_t)act->sa_handler; - } else if ((intptr_t)act->sa_handler >= (intptr_t)&_base + kSigactionMinRva && - (intptr_t)act->sa_handler < (intptr_t)&_base + INT_MAX) { - rva = (int)((uintptr_t)act->sa_handler - (uintptr_t)&_base); + } else if ((intptr_t)act->sa_handler >= + (intptr_t)&__executable_start + kSigactionMinRva && + (intptr_t)act->sa_handler < + (intptr_t)&__executable_start + INT_MAX) { + rva = (int)((uintptr_t)act->sa_handler - (uintptr_t)&__executable_start); } else { return efault(); } @@ -249,8 +252,9 @@ static int __sigaction(int sig, const struct sigaction *act, if (oldact) { oldrva = __sighandrvas[sig]; oldact->sa_sigaction = - (sigaction_f)(oldrva < kSigactionMinRva ? oldrva - : (intptr_t)&_base + oldrva); + (sigaction_f)(oldrva < kSigactionMinRva + ? oldrva + : (intptr_t)&__executable_start + oldrva); } if (act) { __sighandrvas[sig] = rva; diff --git a/libc/calls/sigenter-freebsd.c b/libc/calls/sigenter-freebsd.c index 673c35ab7..1e0ff1f33 100644 --- a/libc/calls/sigenter-freebsd.c +++ b/libc/calls/sigenter-freebsd.c @@ -45,7 +45,7 @@ privileged void __sigenter_freebsd(int sig, struct siginfo_freebsd *freebsdinfo, if (rva >= kSigactionMinRva) { flags = __sighandflags[sig & (NSIG - 1)]; if (~flags & SA_SIGINFO) { - ((sigaction_f)(_base + rva))(sig, 0, 0); + ((sigaction_f)(__executable_start + rva))(sig, 0, 0); } else { __repstosb(&g, 0, sizeof(g)); g.uc.uc_mcontext.fpregs = &g.uc.__fpustate; @@ -78,7 +78,7 @@ privileged void __sigenter_freebsd(int sig, struct siginfo_freebsd *freebsdinfo, g.uc.uc_mcontext.trapno = ctx->uc_mcontext.mc_trapno; __repmovsb(&g.uc.__fpustate, &ctx->uc_mcontext.mc_fpstate, 512); __siginfo2cosmo(&g.si, (void *)freebsdinfo); - ((sigaction_f)(_base + rva))(sig, &g.si, &g.uc); + ((sigaction_f)(__executable_start + rva))(sig, &g.si, &g.uc); ctx->uc_stack.ss_sp = g.uc.uc_stack.ss_sp; ctx->uc_stack.ss_size = g.uc.uc_stack.ss_size; ctx->uc_stack.ss_flags = g.uc.uc_stack.ss_flags; diff --git a/libc/calls/sigenter-linux.c b/libc/calls/sigenter-linux.c index 9165507fd..ceb7c8b59 100644 --- a/libc/calls/sigenter-linux.c +++ b/libc/calls/sigenter-linux.c @@ -44,7 +44,7 @@ privileged void __sigenter_wsl(int sig, struct siginfo *info, ucontext_t *ctx) { memcpy(ctx->__fpustate.st + i, &nan, 16); } } - ((sigaction_f)(_base + rva))(sig, info, ctx); + ((sigaction_f)(__executable_start + rva))(sig, info, ctx); } } diff --git a/libc/calls/sigenter-netbsd.c b/libc/calls/sigenter-netbsd.c index c502335c6..17c3e003a 100644 --- a/libc/calls/sigenter-netbsd.c +++ b/libc/calls/sigenter-netbsd.c @@ -43,7 +43,7 @@ privileged void __sigenter_netbsd(int sig, struct siginfo_netbsd *si, if (rva >= kSigactionMinRva) { flags = __sighandflags[sig & (NSIG - 1)]; if (~flags & SA_SIGINFO) { - ((sigaction_f)(_base + rva))(sig, 0, 0); + ((sigaction_f)(__executable_start + rva))(sig, 0, 0); } else { __repstosb(&uc, 0, sizeof(uc)); __siginfo2cosmo(&si2, (void *)si); @@ -75,7 +75,7 @@ privileged void __sigenter_netbsd(int sig, struct siginfo_netbsd *si, uc.uc_mcontext.rip = ctx->uc_mcontext.rip; uc.uc_mcontext.rsp = ctx->uc_mcontext.rsp; *uc.uc_mcontext.fpregs = ctx->uc_mcontext.__fpregs; - ((sigaction_f)(_base + rva))(sig, &si2, &uc); + ((sigaction_f)(__executable_start + rva))(sig, &si2, &uc); ctx->uc_stack.ss_sp = uc.uc_stack.ss_sp; ctx->uc_stack.ss_size = uc.uc_stack.ss_size; ctx->uc_stack.ss_flags = uc.uc_stack.ss_flags; diff --git a/libc/calls/sigenter-openbsd.c b/libc/calls/sigenter-openbsd.c index 8cae4fa99..27c758670 100644 --- a/libc/calls/sigenter-openbsd.c +++ b/libc/calls/sigenter-openbsd.c @@ -45,7 +45,7 @@ privileged void __sigenter_openbsd(int sig, struct siginfo_openbsd *openbsdinfo, if (rva >= kSigactionMinRva) { flags = __sighandflags[sig & (NSIG - 1)]; if (~flags & SA_SIGINFO) { - ((sigaction_f)(_base + rva))(sig, 0, 0); + ((sigaction_f)(__executable_start + rva))(sig, 0, 0); } else { __repstosb(&g.uc, 0, sizeof(g.uc)); __siginfo2cosmo(&g.si, (void *)openbsdinfo); @@ -76,7 +76,7 @@ privileged void __sigenter_openbsd(int sig, struct siginfo_openbsd *openbsdinfo, if (ctx->sc_fpstate) { *g.uc.uc_mcontext.fpregs = *ctx->sc_fpstate; } - ((sigaction_f)(_base + rva))(sig, &g.si, &g.uc); + ((sigaction_f)(__executable_start + rva))(sig, &g.si, &g.uc); ctx->sc_mask = g.uc.uc_sigmask.__bits[0]; ctx->sc_rdi = g.uc.uc_mcontext.rdi; ctx->sc_rsi = g.uc.uc_mcontext.rsi; diff --git a/libc/calls/sigenter-xnu.c b/libc/calls/sigenter-xnu.c index 6d0e914e0..c1dca4410 100644 --- a/libc/calls/sigenter-xnu.c +++ b/libc/calls/sigenter-xnu.c @@ -31,7 +31,6 @@ #include "libc/runtime/runtime.h" #include "libc/str/str.h" #include "libc/sysv/consts/sa.h" -#ifdef __x86_64__ /** * @fileoverview XNU kernel callback normalization. @@ -345,10 +344,37 @@ struct __darwin_mcontext_avx512_64_full { struct __darwin_x86_avx512_state64 __fs; }; +struct __darwin_arm_exception_state64 { + uint64_t far; + uint32_t esr; + uint32_t exception; +}; + +struct __darwin_arm_thread_state64 { + uint64_t __x[29]; + uint64_t __fp; + uint64_t __lr; + uint64_t __sp; + uint64_t __pc; + uint32_t __cpsr; + uint32_t __pad; +}; + +struct __darwin_arm_vfp_state { + uint32_t __r[64]; + uint32_t __fpscr; +}; + struct __darwin_mcontext64 { +#ifdef __x86_64__ struct __darwin_x86_exception_state64 __es; struct __darwin_x86_thread_state64 __ss; struct __darwin_x86_float_state64 __fs; +#elif defined(__aarch64__) + struct __darwin_arm_exception_state64 __es; + struct __darwin_arm_thread_state64 __ss; + struct __darwin_arm_vfp_state __fs; +#endif }; struct __darwin_ucontext { @@ -360,6 +386,8 @@ struct __darwin_ucontext { struct __darwin_mcontext64 *uc_mcontext; }; +#ifdef __x86_64__ + static privileged void xnuexceptionstate2linux( mcontext_t *mc, struct __darwin_x86_exception_state64 *xnues) { mc->trapno = xnues->__trapno; @@ -455,6 +483,8 @@ static privileged void linuxssefpustate2xnu( CopyFpXmmRegs(&xnufs->__fpu_stmm0, fs->st); } +#endif /* __x86_64__ */ + privileged void __sigenter_xnu(void *fn, int infostyle, int sig, struct siginfo_xnu *xnuinfo, struct __darwin_ucontext *xnuctx) { @@ -468,15 +498,17 @@ privileged void __sigenter_xnu(void *fn, int infostyle, int sig, if (rva >= kSigactionMinRva) { flags = __sighandflags[sig & (NSIG - 1)]; if (~flags & SA_SIGINFO) { - ((sigaction_f)(_base + rva))(sig, 0, 0); + ((sigaction_f)(__executable_start + rva))(sig, 0, 0); } else { __repstosb(&g, 0, sizeof(g)); + if (xnuctx) { g.uc.uc_sigmask.__bits[0] = xnuctx->uc_sigmask; g.uc.uc_sigmask.__bits[1] = 0; g.uc.uc_stack.ss_sp = xnuctx->uc_stack.ss_sp; g.uc.uc_stack.ss_flags = xnuctx->uc_stack.ss_flags; g.uc.uc_stack.ss_size = xnuctx->uc_stack.ss_size; +#ifdef __x86_64__ g.uc.uc_mcontext.fpregs = &g.uc.__fpustate; if (xnuctx->uc_mcontext) { if (xnuctx->uc_mcsize >= @@ -493,16 +525,24 @@ privileged void __sigenter_xnu(void *fn, int infostyle, int sig, xnussefpustate2linux(&g.uc.__fpustate, &xnuctx->uc_mcontext->__fs); } } +#elif defined(__aarch64__) + if (xnuctx->uc_mcontext) { + memcpy(g.uc.uc_mcontext.regs, &xnuctx->uc_mcontext->__ss.__x, 33 * 8); + } +#endif /* __x86_64__ */ } + if (xnuinfo) { __siginfo2cosmo(&g.si, (void *)xnuinfo); } - ((sigaction_f)(_base + rva))(sig, &g.si, &g.uc); + ((sigaction_f)(__executable_start + rva))(sig, &g.si, &g.uc); + if (xnuctx) { xnuctx->uc_stack.ss_sp = g.uc.uc_stack.ss_sp; xnuctx->uc_stack.ss_flags = g.uc.uc_stack.ss_flags; xnuctx->uc_stack.ss_size = g.uc.uc_stack.ss_size; xnuctx->uc_sigmask = g.uc.uc_sigmask.__bits[0]; +#ifdef __x86_64__ if (xnuctx->uc_mcontext) { if (xnuctx->uc_mcsize >= sizeof(struct __darwin_x86_exception_state64)) { @@ -519,14 +559,29 @@ privileged void __sigenter_xnu(void *fn, int infostyle, int sig, linuxssefpustate2xnu(&xnuctx->uc_mcontext->__fs, &g.uc.__fpustate); } } +#elif defined(__aarch64__) + if (xnuctx->uc_mcontext) { + memcpy(&xnuctx->uc_mcontext->__ss.__x, g.uc.uc_mcontext.regs, 33 * 8); + } +#endif /* __x86_64__ */ } } } + +#ifdef __x86_64__ asm volatile("syscall" : "=a"(ax) : "0"(0x20000b8 /* sigreturn */), "D"(xnuctx), "S"(infostyle) : "rcx", "r11", "memory", "cc"); +#else + register long r0 asm("x0") = (long)xnuctx; + register long r1 asm("x1") = (long)infostyle; + asm volatile("mov\tx16,%0\n\t" + "svc\t0" + : /* no outputs */ + : "i"(0x0b8 /* sigreturn */), "r"(r0), "r"(r1) + : "x16", "memory"); +#endif /* __x86_64__ */ + notpossible; } - -#endif diff --git a/libc/calls/umask.c b/libc/calls/umask.c index d667403a0..93daff6fb 100644 --- a/libc/calls/umask.c +++ b/libc/calls/umask.c @@ -17,9 +17,27 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" -#include "libc/calls/syscall-sysv.internal.h" #include "libc/dce.h" #include "libc/intrin/strace.internal.h" +#include "libc/sysv/consts/nr.h" + +static inline unsigned sys_umask(unsigned newmask) { +#ifdef __x86_64__ + unsigned res; + asm volatile("syscall" + : "=a"(res) + : "0"(__NR_umask), "D"(newmask) + : "memory", "cc"); +#elif defined(__aarch64__) + // xnu m1 doesn't manage carry flag + register long r0 asm("x0") = newmask; + register long r8 asm("x8") = __NR_umask & 0x7ff; + register long r16 asm("x16") = __NR_umask & 0x7ff; + register unsigned res asm("x0"); + asm volatile("svc\t0" : "=r"(res) : "r"(r0), "r"(r8), "r"(r16) : "memory"); +#endif + return res; +} /** * Sets file mode creation mask. diff --git a/libc/calls/weirdtypes.h b/libc/calls/weirdtypes.h index f0180c0f7..aee41190b 100644 --- a/libc/calls/weirdtypes.h +++ b/libc/calls/weirdtypes.h @@ -43,7 +43,7 @@ #define nlink_t uint64_t #elif defined(__aarch64__) #define blksize_t int32_t -#define nlink_t uint32_t +#define nlink_t uint32_t /* uint16_t on xnu */ #endif #define TIME_T_MAX __INT64_MAX__ diff --git a/libc/crt/crt.S b/libc/crt/crt.S index c35b46502..9b24c907d 100644 --- a/libc/crt/crt.S +++ b/libc/crt/crt.S @@ -128,6 +128,11 @@ _start: // setup backtraces mov x29,#0 +// second arg shall be struct Syslib passed by ape-m1.c +// used to talk to apple's authoritarian libraries +// should be set to zero on other platforms + mov x1,x15 + // switch to c code bl cosmo .unreachable diff --git a/libc/dce.h b/libc/dce.h index 92c248056..51c4cc89e 100644 --- a/libc/dce.h +++ b/libc/dce.h @@ -12,7 +12,7 @@ */ #define SUPPORT_VECTOR 255 #else -#define SUPPORT_VECTOR _HOSTLINUX +#define SUPPORT_VECTOR (_HOSTLINUX | _HOSTXNU) #endif #endif @@ -110,11 +110,11 @@ #if !(__ASSEMBLER__ + __LINKER__ + 0) COSMOPOLITAN_C_START_ -#ifdef __x86_64__ extern const int __hostos; + +#ifdef __x86_64__ bool IsWsl1(void); #else -#define __hostos _HOSTLINUX #define IsWsl1() false #endif diff --git a/libc/intrin/aarch64/memchr.S b/libc/intrin/aarch64/memchr.S index 771bc3f2f..ba2cebf3d 100644 --- a/libc/intrin/aarch64/memchr.S +++ b/libc/intrin/aarch64/memchr.S @@ -29,7 +29,7 @@ #define __memchr_aarch64 memchr -.ident "\n\ +.ident "\n\n\ Optimized Routines (MIT License)\n\ Copyright 2022 ARM Limited\n" .include "libc/disclaimer.inc" diff --git a/libc/intrin/aarch64/memcmp.S b/libc/intrin/aarch64/memcmp.S index f36782ca0..fe8a7086a 100644 --- a/libc/intrin/aarch64/memcmp.S +++ b/libc/intrin/aarch64/memcmp.S @@ -29,7 +29,7 @@ #define __memcmp_aarch64 memcmp -.ident "\n\ +.ident "\n\n\ Optimized Routines (MIT License)\n\ Copyright 2022 ARM Limited\n" .include "libc/disclaimer.inc" diff --git a/libc/intrin/aarch64/memcpy.S b/libc/intrin/aarch64/memcpy.S index 871e81fdc..bbbed20f4 100644 --- a/libc/intrin/aarch64/memcpy.S +++ b/libc/intrin/aarch64/memcpy.S @@ -30,7 +30,7 @@ #define __memcpy_aarch64_simd memcpy #define __memmove_aarch64_simd memmove -.ident "\n\ +.ident "\n\n\ Optimized Routines (MIT License)\n\ Copyright 2022 ARM Limited\n" .include "libc/disclaimer.inc" diff --git a/libc/intrin/aarch64/memrchr.S b/libc/intrin/aarch64/memrchr.S index 879181263..3b2326189 100644 --- a/libc/intrin/aarch64/memrchr.S +++ b/libc/intrin/aarch64/memrchr.S @@ -29,7 +29,7 @@ #define __memrchr_aarch64 memrchr -.ident "\n\ +.ident "\n\n\ Optimized Routines (MIT License)\n\ Copyright 2022 ARM Limited\n" .include "libc/disclaimer.inc" diff --git a/libc/intrin/aarch64/memset.S b/libc/intrin/aarch64/memset.S index 128770f47..6cb7174fa 100644 --- a/libc/intrin/aarch64/memset.S +++ b/libc/intrin/aarch64/memset.S @@ -29,7 +29,7 @@ #define __memset_aarch64 memset -.ident "\n\ +.ident "\n\n\ Optimized Routines (MIT License)\n\ Copyright 2022 ARM Limited\n" .include "libc/disclaimer.inc" diff --git a/libc/intrin/aarch64/stpcpy.S b/libc/intrin/aarch64/stpcpy.S index d11074d3f..a0e22aac9 100644 --- a/libc/intrin/aarch64/stpcpy.S +++ b/libc/intrin/aarch64/stpcpy.S @@ -29,7 +29,7 @@ #define __stpcpy_aarch64 stpcpy -.ident "\n\ +.ident "\n\n\ Optimized Routines (MIT License)\n\ Copyright 2022 ARM Limited\n" .include "libc/disclaimer.inc" diff --git a/libc/intrin/aarch64/strchr.S b/libc/intrin/aarch64/strchr.S index 3a11580b0..1989cda7f 100644 --- a/libc/intrin/aarch64/strchr.S +++ b/libc/intrin/aarch64/strchr.S @@ -29,7 +29,7 @@ #define __strchr_aarch64 strchr -.ident "\n\ +.ident "\n\n\ Optimized Routines (MIT License)\n\ Copyright 2022 ARM Limited\n" .include "libc/disclaimer.inc" diff --git a/libc/intrin/aarch64/strchrnul.S b/libc/intrin/aarch64/strchrnul.S index 1896e351c..207100e6c 100644 --- a/libc/intrin/aarch64/strchrnul.S +++ b/libc/intrin/aarch64/strchrnul.S @@ -29,7 +29,7 @@ #define __strchrnul_aarch64 strchrnul -.ident "\n\ +.ident "\n\n\ Optimized Routines (MIT License)\n\ Copyright 2022 ARM Limited\n" .include "libc/disclaimer.inc" diff --git a/libc/intrin/aarch64/strcmp.S b/libc/intrin/aarch64/strcmp.S index 15ccd59e9..f48df8eef 100644 --- a/libc/intrin/aarch64/strcmp.S +++ b/libc/intrin/aarch64/strcmp.S @@ -29,7 +29,7 @@ #define __strcmp_aarch64 strcmp -.ident "\n\ +.ident "\n\n\ Optimized Routines (MIT License)\n\ Copyright 2022 ARM Limited\n" .include "libc/disclaimer.inc" diff --git a/libc/intrin/aarch64/strcpy.S b/libc/intrin/aarch64/strcpy.S index cc7834101..5134c3765 100644 --- a/libc/intrin/aarch64/strcpy.S +++ b/libc/intrin/aarch64/strcpy.S @@ -29,7 +29,7 @@ #define __strcpy_aarch64 strcpy -.ident "\n\ +.ident "\n\n\ Optimized Routines (MIT License)\n\ Copyright 2022 ARM Limited\n" .include "libc/disclaimer.inc" diff --git a/libc/intrin/aarch64/strlen.S b/libc/intrin/aarch64/strlen.S index 588b12019..89a0fc4f0 100644 --- a/libc/intrin/aarch64/strlen.S +++ b/libc/intrin/aarch64/strlen.S @@ -29,7 +29,7 @@ #define __strlen_aarch64 strlen -.ident "\n\ +.ident "\n\n\ Optimized Routines (MIT License)\n\ Copyright 2022 ARM Limited\n" .include "libc/disclaimer.inc" diff --git a/libc/intrin/aarch64/strncmp.S b/libc/intrin/aarch64/strncmp.S index 113a69092..6b2e753d5 100644 --- a/libc/intrin/aarch64/strncmp.S +++ b/libc/intrin/aarch64/strncmp.S @@ -29,7 +29,7 @@ #define __strncmp_aarch64 strncmp -.ident "\n\ +.ident "\n\n\ Optimized Routines (MIT License)\n\ Copyright 2022 ARM Limited\n" .include "libc/disclaimer.inc" diff --git a/libc/intrin/aarch64/strnlen.S b/libc/intrin/aarch64/strnlen.S index bbc003c5e..ab764d5a5 100644 --- a/libc/intrin/aarch64/strnlen.S +++ b/libc/intrin/aarch64/strnlen.S @@ -29,7 +29,7 @@ #define __strnlen_aarch64 strnlen -.ident "\n\ +.ident "\n\n\ Optimized Routines (MIT License)\n\ Copyright 2022 ARM Limited\n" .include "libc/disclaimer.inc" diff --git a/libc/intrin/aarch64/strrchr.S b/libc/intrin/aarch64/strrchr.S index cff728179..49cefbc77 100644 --- a/libc/intrin/aarch64/strrchr.S +++ b/libc/intrin/aarch64/strrchr.S @@ -29,7 +29,7 @@ #define __strrchr_aarch64 strrchr -.ident "\n\ +.ident "\n\n\ Optimized Routines (MIT License)\n\ Copyright 2022 ARM Limited\n" .include "libc/disclaimer.inc" diff --git a/libc/intrin/asan.c b/libc/intrin/asan.c index ce54a162b..ea0b00a60 100644 --- a/libc/intrin/asan.c +++ b/libc/intrin/asan.c @@ -412,7 +412,7 @@ static bool __asan_is_mapped(int x) { } static bool __asan_is_image(const unsigned char *p) { - return _base <= p && p < _end; + return __executable_start <= p && p < _end; } static bool __asan_exists(const void *x) { @@ -823,7 +823,7 @@ static void __asan_report_memory_origin(const unsigned char *addr, int size, default: break; } - if (_base <= addr && addr < _end) { + if (__executable_start <= addr && addr < _end) { __asan_report_memory_origin_image((intptr_t)addr, size); } else if (IsAutoFrame((intptr_t)addr >> 16)) { __asan_report_memory_origin_heap(addr, size); @@ -898,7 +898,7 @@ dontdiscard static __asan_die_f *__asan_report(const void *addr, int size, } *p++ = '\n'; } - p = __asan_format_section(p, _base, _etext, ".text", addr); + p = __asan_format_section(p, __executable_start, _etext, ".text", addr); p = __asan_format_section(p, _etext, _edata, ".data", addr); p = __asan_format_section(p, _end, _edata, ".bss", addr); __mmi_lock(); @@ -1487,7 +1487,7 @@ void __asan_init(int argc, char **argv, char **envp, intptr_t *auxv) { REQUIRE(dlmalloc_usable_size); } __asan_shadow_existing_mappings(); - __asan_map_shadow((uintptr_t)_base, _end - _base); + __asan_map_shadow((uintptr_t)__executable_start, _end - __executable_start); __asan_map_shadow(0, 4096); __asan_poison(0, GUARDSIZE, kAsanNullPage); if (!IsWindows()) { diff --git a/libc/intrin/assertfail.greg.c b/libc/intrin/assertfail.greg.c index fe80c9271..df0ab2c36 100644 --- a/libc/intrin/assertfail.greg.c +++ b/libc/intrin/assertfail.greg.c @@ -20,6 +20,7 @@ #include "libc/atomic.h" #include "libc/calls/state.internal.h" #include "libc/calls/syscall-sysv.internal.h" +#include "libc/errno.h" #include "libc/intrin/atomic.h" #include "libc/intrin/kprintf.h" #include "libc/intrin/weaken.h" @@ -38,7 +39,7 @@ relegated void __assert_fail(const char *expr, const char *file, int line) { owner = 0; me = sys_gettid(); pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, 0); - kprintf("%s:%d: assert(%s) failed (tid %d)\n", file, line, expr, me); + kprintf("%s:%d: assert(%s) failed (tid %d) %m\n", file, line, expr, me); if (__vforked || atomic_compare_exchange_strong_explicit( &once, &owner, me, memory_order_relaxed, memory_order_relaxed)) { diff --git a/libc/intrin/describeframe.c b/libc/intrin/describeframe.c index c8c7fad8a..735f58665 100644 --- a/libc/intrin/describeframe.c +++ b/libc/intrin/describeframe.c @@ -66,7 +66,7 @@ static const char *GetFrameName(int x) { sizeof(struct WinArgs) - 1) >> 16))) { return "winargs"; - } else if ((int)((intptr_t)_base >> 16) <= x && + } else if ((int)((intptr_t)__executable_start >> 16) <= x && x <= (int)(((intptr_t)_end - 1) >> 16)) { return "image"; } else { diff --git a/libc/intrin/directmap.c b/libc/intrin/directmap.c index 865c8b972..f9fd91840 100644 --- a/libc/intrin/directmap.c +++ b/libc/intrin/directmap.c @@ -62,9 +62,11 @@ struct DirectMap sys_mmap(void *addr, size_t size, int prot, int flags, int fd, register long res_x0 asm("x0"); long res; asm volatile("mov\tx8,%1\n\t" + "mov\tx16,%2\n\t" "svc\t0" : "=r"(res_x0) - : "i"(222), "r"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4), "r"(r5) + : "i"(222), "i"(197), "r"(r0), "r"(r1), "r"(r2), "r"(r3), + "r"(r4), "r"(r5) : "x8", "memory"); res = res_x0; if ((unsigned long)res >= (unsigned long)-4095) { diff --git a/libc/intrin/exit.c b/libc/intrin/exit.c index 1e0a4203f..cc4bfa3cb 100644 --- a/libc/intrin/exit.c +++ b/libc/intrin/exit.c @@ -68,10 +68,11 @@ wontreturn void _Exit(int exitcode) { #elif defined(__aarch64__) register long x0 asm("x0") = exitcode; asm volatile("mov\tx8,%0\n\t" + "mov\tx16,%1\n\t" "svc\t0" : /* no outputs */ - : "i"(94), "r"(x0) - : "x8", "memory"); + : "i"(94), "i"(1), "r"(x0) + : "x8", "x16", "memory"); notpossible; #else #error "arch unsupported" diff --git a/libc/intrin/exit1.greg.c b/libc/intrin/exit1.greg.c index a7541767b..82832e259 100644 --- a/libc/intrin/exit1.greg.c +++ b/libc/intrin/exit1.greg.c @@ -76,9 +76,10 @@ privileged wontreturn void _Exit1(int rc) { #elif defined(__aarch64__) register long r0 asm("x0") = rc; asm volatile("mov\tx8,%0\n\t" + "mov\tx16,%1\n\t" "svc\t0" : /* no outputs */ - : "i"(93), "r"(r0) + : "i"(93), "i"(0x169), "r"(r0) : "x8", "memory"); notpossible; #else diff --git a/libc/intrin/kprintf.greg.c b/libc/intrin/kprintf.greg.c index 9728686b8..5b2364b0f 100644 --- a/libc/intrin/kprintf.greg.c +++ b/libc/intrin/kprintf.greg.c @@ -130,11 +130,13 @@ privileged static inline bool kiskernelpointer(const void *p) { } privileged static inline bool kistextpointer(const void *p) { - return _base <= (const unsigned char *)p && (const unsigned char *)p < _etext; + return __executable_start <= (const unsigned char *)p && + (const unsigned char *)p < _etext; } privileged static inline bool kisimagepointer(const void *p) { - return _base <= (const unsigned char *)p && (const unsigned char *)p < _end; + return __executable_start <= (const unsigned char *)p && + (const unsigned char *)p < _end; } privileged static inline bool kischarmisaligned(const char *p, signed char t) { @@ -224,11 +226,12 @@ privileged static void klog(const char *b, size_t n) { register long r0 asm("x0") = (long)2; register long r1 asm("x1") = (long)b; register long r2 asm("x2") = (long)n; - register long r8 asm("x8") = (long)__NR_write; + register long r8 asm("x8") = (long)__NR_write & 0x7ff; + register long r16 asm("x16") = (long)__NR_write & 0x7ff; register long res_x0 asm("x0"); asm volatile("svc\t0" : "=r"(res_x0) - : "r"(r0), "r"(r1), "r"(r2), "r"(r8) + : "r"(r0), "r"(r1), "r"(r2), "r"(r8), "r"(r16) : "memory"); #else #error "unsupported architecture" diff --git a/libc/intrin/nopl.internal.h b/libc/intrin/nopl.internal.h index 77acc2aa7..c8385f21f 100644 --- a/libc/intrin/nopl.internal.h +++ b/libc/intrin/nopl.internal.h @@ -20,7 +20,7 @@ #define _NOPL_PROLOGUE(SECTION) \ ".section \".sort.rodata." SECTION ".1" \ "\",\"aG\",@progbits,\"" SECTION "\",comdat\n\t" \ - ".align\t4\n\t" \ + ".balign\t4\n\t" \ ".type\t\"" SECTION "_start\",@object\n\t" \ ".globl\t\"" SECTION "_start\"\n\t" \ ".equ\t\"" SECTION "_start\",.\n\t" \ @@ -29,7 +29,7 @@ #define _NOPL_EPILOGUE(SECTION) \ ".section \".sort.rodata." SECTION ".3" \ "\",\"aG\",@progbits,\"" SECTION "\",comdat\n\t" \ - ".align\t4\n\t" \ + ".balign\t4\n\t" \ ".type\"" SECTION "_end\",@object\n\t" \ ".globl\t\"" SECTION "_end\"\n\t" \ ".equ\t\"" SECTION "_end\",.\n\t" \ @@ -40,7 +40,7 @@ asm volatile(_NOPL_PROLOGUE(SECTION) /* */ \ _NOPL_EPILOGUE(SECTION) /* */ \ ".section \".sort.rodata." SECTION ".2\",\"a\",@progbits\n\t" \ - ".align\t4\n\t" \ + ".balign\t4\n\t" \ ".long\t353f-%a1\n\t" \ ".previous\n353:\t" \ "nopl\t%a0" \ @@ -57,7 +57,7 @@ asm volatile(_NOPL_PROLOGUE(SECTION) /* */ \ _NOPL_EPILOGUE(SECTION) /* */ \ ".section \".sort.rodata." SECTION ".2\",\"a\",@progbits\n\t" \ - ".align\t4\n\t" \ + ".balign\t4\n\t" \ ".long\t353f-%a2\n\t" \ ".previous\n353:\t" \ "nopl\t%a1" \ diff --git a/libc/intrin/stracef.greg.c b/libc/intrin/stracef.greg.c index 544d2fc63..344f5a072 100644 --- a/libc/intrin/stracef.greg.c +++ b/libc/intrin/stracef.greg.c @@ -19,6 +19,7 @@ #include "libc/intrin/kprintf.h" #include "libc/intrin/strace.internal.h" #include "libc/runtime/runtime.h" +#include "libc/thread/tls.h" #include "libc/thread/tls2.h" privileged void __stracef(const char *fmt, ...) { diff --git a/libc/intrin/sys_gettid.greg.c b/libc/intrin/sys_gettid.greg.c index 26818fd18..3b50ca6a2 100644 --- a/libc/intrin/sys_gettid.greg.c +++ b/libc/intrin/sys_gettid.greg.c @@ -65,9 +65,10 @@ privileged int sys_gettid(void) { #elif defined(__aarch64__) register long res_x0 asm("x0"); asm volatile("mov\tx8,%1\n\t" + "mov\tx16,%2\n\t" "svc\t0" : "=r"(res_x0) - : "i"(178) + : "i"(178), "i"(186) : "x8", "memory"); return res_x0; #else diff --git a/libc/log/countbranch.h b/libc/log/countbranch.h index f396bf30a..9b6077589 100644 --- a/libc/log/countbranch.h +++ b/libc/log/countbranch.h @@ -12,7 +12,7 @@ COSMOPOLITAN_C_START_ bool Cond; \ struct countbranch *Info; \ asm(".section .rodata.str1.1,\"aMS\",@progbits,1\n\t" \ - ".align\t1\n" \ + ".balign\t1\n" \ "31338:\t" \ ".asciz\t" xs "\n" \ "31339:\t" \ @@ -24,7 +24,7 @@ COSMOPOLITAN_C_START_ "nopl\tcountbranch_data(%%rip)\n\t" \ ".previous\n\t" \ ".section .sort.data.countbranch.2,\"a\",@progbits\n\t" \ - ".align\t8\n31337:\t" \ + ".balign\t8\n31337:\t" \ ".quad\t0\n\t" \ ".quad\t0\n\t" \ ".quad\t31338b\n\t" \ diff --git a/libc/log/countexpr.h b/libc/log/countexpr.h index 8ef7af320..ac8f28a41 100644 --- a/libc/log/countexpr.h +++ b/libc/log/countexpr.h @@ -40,7 +40,7 @@ COSMOPOLITAN_C_START_ t2_ = stop(); \ TiCkS = t2_ >= t1_ ? t2_ - t1_ : ~t1_ + t2_ + 1; \ asm(".section .rodata.str1.1,\"aMS\",@progbits,1\n\t" \ - ".align\t1\n" \ + ".balign\t1\n" \ "31340:\t.asciz\t" file "\n\t" \ "31338:\t.asciz\t" code "\n" \ "31332:\t.asciz\t" macro "\n" \ @@ -49,7 +49,7 @@ COSMOPOLITAN_C_START_ "nopl\tcountexpr_data(%%rip)\n\t" \ ".previous\n\t" \ ".section .sort.data.countexpr.2,\"a\",@progbits\n\t" \ - ".align\t8\n31337:\t" \ + ".balign\t8\n31337:\t" \ ".quad\t" #line "\n\t" \ ".quad\t31340b\n\t" \ ".quad\t31338b\n\t" \ diff --git a/libc/log/libfatal.internal.h b/libc/log/libfatal.internal.h index 0367110d7..ee8849190 100644 --- a/libc/log/libfatal.internal.h +++ b/libc/log/libfatal.internal.h @@ -19,12 +19,13 @@ forceinline long __sysv_exit(long rc) { : "memory", "cc"); #elif defined(__aarch64__) register long r0 asm("x0") = rc; - register long r8 asm("x8") = __NR_exit_group; + register long r8 asm("x8") = __NR_exit_group & 0x7ff; + register long r16 asm("x16") = __NR_exit_group & 0x7ff; register long res_x0 asm("x0"); - asm volatile("svc\t0" : "=r"(res_x0) : "r"(r0), "r"(r8) : "memory"); + asm volatile("svc\t0" : "=r"(res_x0) : "r"(r0), "r"(r8), "r"(r16) : "memory"); ax = res_x0; #else - ax = syscall(__NR_exit_group, rc); + ax = syscall(__NR_exit_group & 0x7ff, rc); #endif return ax; } @@ -38,16 +39,17 @@ forceinline int __sysv_close(long fd) { : "rdx", "memory", "cc"); #elif defined(__aarch64__) register long r0 asm("x0") = fd; - register long r8 asm("x8") = __NR_close; + register long r8 asm("x8") = __NR_close & 0x7ff; + register long r16 asm("x16") = __NR_close & 0x7ff; register long res_x0 asm("x0"); asm volatile("mov\tx8,%1\n\t" "svc\t0" : "=r"(res_x0) - : "r"(r0), "r"(r8) + : "r"(r0), "r"(r8), "r"(r16) : "memory"); ax = res_x0; #else - ax = syscall(__NR_close, fd); + ax = syscall(__NR_close & 0x7ff, fd); #endif return ax; } @@ -64,15 +66,16 @@ forceinline int __sysv_open(const char *path, long flags, long mode) { register long r1 asm("x1") = (long)path; register long r2 asm("x2") = (long)flags; register long r3 asm("x3") = (long)mode; - register long r8 asm("x8") = (long)__NR_open; + register long r8 asm("x8") = (long)__NR_open & 0x7ff; + register long r16 asm("x16") = (long)__NR_open & 0x7ff; register long res_x0 asm("x0"); asm volatile("svc\t0" : "=r"(res_x0) - : "r"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r8) + : "r"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r8), "r"(r16) : "memory"); ax = res_x0; #else - ax = syscall(__NR_open, path, flags, mode); + ax = syscall(__NR_open & 0x7ff, path, flags, mode); #endif return ax; } @@ -88,15 +91,16 @@ forceinline long __sysv_read(long fd, void *data, unsigned long size) { register long r0 asm("x0") = (long)fd; register long r1 asm("x1") = (long)data; register long r2 asm("x2") = (long)size; - register long r8 asm("x8") = (long)__NR_read; + register long r8 asm("x8") = (long)__NR_read & 0x7ff; + register long r16 asm("x16") = (long)__NR_read & 0x7ff; register long res_x0 asm("x0"); asm volatile("svc\t0" : "=r"(res_x0) - : "r"(r0), "r"(r1), "r"(r2), "r"(r8) + : "r"(r0), "r"(r1), "r"(r2), "r"(r8), "r"(r16) : "memory"); ax = res_x0; #else - ax = syscall(__NR_read, fd, data, size); + ax = syscall(__NR_read & 0x7ff, fd, data, size); #endif return ax; } @@ -112,15 +116,16 @@ forceinline long __sysv_write(long fd, const void *data, unsigned long size) { register long r0 asm("x0") = (long)fd; register long r1 asm("x1") = (long)data; register long r2 asm("x2") = (long)size; - register long r8 asm("x8") = (long)__NR_write; + register long r8 asm("x8") = (long)__NR_write & 0x7ff; + register long r16 asm("x16") = (long)__NR_write & 0x7ff; register long res_x0 asm("x0"); asm volatile("svc\t0" : "=r"(res_x0) - : "i"(64), "r"(r0), "r"(r1), "r"(r2), "r"(r8) + : "i"(64), "r"(r0), "r"(r1), "r"(r2), "r"(r8), "r"(r16) : "memory"); ax = res_x0; #else - ax = syscall(__NR_write, fd, data, size); + ax = syscall(__NR_write & 0x7ff, fd, data, size); #endif return ax; } @@ -136,15 +141,16 @@ forceinline long __sysv_mprotect(void *addr, size_t size, long prot) { register long r0 asm("x0") = (long)addr; register long r1 asm("x1") = (long)size; register long r2 asm("x2") = (long)prot; - register long r8 asm("x8") = (long)__NR_mprotect; + register long r8 asm("x8") = (long)__NR_mprotect & 0x7ff; + register long r16 asm("x16") = (long)__NR_mprotect & 0x7ff; register long res_x0 asm("x0"); asm volatile("svc\t0" : "=r"(res_x0) - : "r"(r0), "r"(r1), "r"(r2), "r"(r8) + : "r"(r0), "r"(r1), "r"(r2), "r"(r8), "r"(r16) : "memory"); ax = res_x0; #else - ax = syscall(__NR_mprotect, addr, size, prot); + ax = syscall(__NR_mprotect & 0x7ff, addr, size, prot); #endif return ax; } @@ -157,12 +163,13 @@ forceinline int __sysv_getpid(void) { : "0"(__NR_getpid) : "rdx", "memory", "cc"); #elif defined(__aarch64__) - register long r8 asm("x8") = (long)__NR_getpid; + register long r8 asm("x8") = (long)__NR_getpid & 0x7ff; + register long r16 asm("x16") = (long)__NR_getpid & 0x7ff; register long res_x0 asm("x0"); - asm volatile("svc\t0" : "=r"(res_x0) : "r"(r8) : "memory"); + asm volatile("svc\t0" : "=r"(res_x0) : "r"(r8), "r"(r16) : "memory"); ax = res_x0; #else - ax = syscall(__NR_getpid); + ax = syscall(__NR_getpid & 0x7ff); #endif return ax; } diff --git a/libc/log/oncrash_amd64.c b/libc/log/oncrash_amd64.c index 90f4e5139..fe0b23187 100644 --- a/libc/log/oncrash_amd64.c +++ b/libc/log/oncrash_amd64.c @@ -317,7 +317,7 @@ relegated void __oncrash_amd64(int sig, struct siginfo *si, void *arg) { // RestoreDefaultCrashSignalHandlers(); gdbpid = AttachDebugger( ((sig == SIGTRAP || sig == SIGQUIT) && - (rip >= (intptr_t)&_base && rip < (intptr_t)&_etext)) + (rip >= (intptr_t)&__executable_start && rip < (intptr_t)&_etext)) ? rip : 0); } diff --git a/libc/log/oncrash_arm64.c b/libc/log/oncrash_arm64.c index a78031999..06698f251 100644 --- a/libc/log/oncrash_arm64.c +++ b/libc/log/oncrash_arm64.c @@ -58,7 +58,7 @@ struct Buffer { }; static bool IsCode(uintptr_t p) { - return _base <= (uint8_t *)p && (uint8_t *)p < _etext; + return __executable_start <= (uint8_t *)p && (uint8_t *)p < _etext; } static void Append(struct Buffer *b, const char *fmt, ...) { @@ -97,8 +97,9 @@ static const char *ColorRegister(int r) { case 25: // saved case 26: // saved case 27: // saved - case 28: // saved return MAGENTA; + case 18: // platform register + case 28: // our tls register case 29: // frame pointer case 30: // return pointer case 31: // stack pointer diff --git a/libc/macros.internal.h b/libc/macros.internal.h index 430c8850b..aa58074a7 100644 --- a/libc/macros.internal.h +++ b/libc/macros.internal.h @@ -124,7 +124,7 @@ // @note therefore no section relative addressing .macro .rodata.str1.1 .section .rodata.str1.1,"aMS",@progbits,1 - .align 1 + .balign 1 .endm // Locates unreferenced code invulnerable to --gc-sections. @@ -150,6 +150,12 @@ .weak \canonical .endm +#ifdef __aarch64__ +.macro jmp dest:req + b \dest +.endm +#endif + // Pulls unrelated module into linkage. // // In order for this technique to work with --gc-sections, another @@ -195,31 +201,31 @@ // @note therefore no section relative addressing .macro .rodata.cst4 .section .rodata.cst4,"aM",@progbits,4 - .align 4 + .balign 4 .endm .macro .rodata.cst8 .section .rodata.cst8,"aM",@progbits,8 - .align 8 + .balign 8 .endm .macro .rodata.cst16 .section .rodata.cst16,"aM",@progbits,16 - .align 16 + .balign 16 .endm .macro .rodata.cst32 .section .rodata.cst32,"aM",@progbits,32 - .align 32 + .balign 32 .endm .macro .rodata.cst64 .section .rodata.cst64,"aM",@progbits,64 - .align 64 + .balign 64 .endm .macro .tdata .section .tdata,"awT",@progbits - .align 4 + .balign 4 .endm .macro .tbss .section .tdata,"awT",@nobits - .align 4 + .balign 4 .endm // Loads address of errno into %rcx @@ -242,11 +248,11 @@ // @see libc/runtime/_init.S .macro .initro number:req name:req .section ".initro.\number\().\name","a",@progbits - .align 8 + .balign 8 .endm .macro .initbss number:req name:req .section ".piro.bss.init.2.\number\().\name","aw",@nobits - .align 8 + .balign 8 .endm .macro .init.start number:req name:req .section ".init.\number\().\name","ax",@progbits diff --git a/libc/nexgen32e/khalfcache3.S b/libc/nexgen32e/khalfcache3.S index 1706392cb..82aa384d4 100644 --- a/libc/nexgen32e/khalfcache3.S +++ b/libc/nexgen32e/khalfcache3.S @@ -66,7 +66,7 @@ kHalfCache3: #else .rodata - .align 8 + .balign 8 kHalfCache3: .quad 4 * 1024 * 1024 .endobj kHalfCache3,globl diff --git a/libc/nexgen32e/threaded.c b/libc/nexgen32e/threaded.c index 6226e1bff..4230175e5 100644 --- a/libc/nexgen32e/threaded.c +++ b/libc/nexgen32e/threaded.c @@ -23,6 +23,8 @@ */ int __threaded; +#ifdef __x86_64__ bool __tls_enabled; +#endif unsigned __tls_index; diff --git a/libc/nexgen32e/zip.S b/libc/nexgen32e/zip.S index ed5985ffa..c734c19f4 100644 --- a/libc/nexgen32e/zip.S +++ b/libc/nexgen32e/zip.S @@ -38,7 +38,8 @@ __zip_end: .short v_zip_records // number of records on disk .short v_zip_records // records .long v_zip_cdirsize // size of central directory - .long RVA(__zip_start) // central directory offset + .weak v_zip_cdoffset + .long v_zip_cdoffset // central directory offset .short v_zip_commentsize // comment size .endobj __zip_end,globl,hidden .weak v_zip_records diff --git a/libc/nt/ntdllimport.S b/libc/nt/ntdllimport.S index 5f0eb3cd9..ce72c4e8e 100644 --- a/libc/nt/ntdllimport.S +++ b/libc/nt/ntdllimport.S @@ -48,8 +48,8 @@ kNtdllProcRvas: 0: lodsq test %rax,%rax jz 1f - .weak _base - lea _base(%rax),%rdx + .weak __executable_start + lea __executable_start(%rax),%rdx mov %r12,%rcx call *__imp_GetProcAddress(%rip) test %rax,%rax diff --git a/libc/runtime/arch_prctl.c b/libc/runtime/arch_prctl.c index c79600a0e..9436a1cbb 100644 --- a/libc/runtime/arch_prctl.c +++ b/libc/runtime/arch_prctl.c @@ -30,6 +30,7 @@ #include "libc/runtime/pc.internal.h" #include "libc/sysv/consts/sig.h" #include "libc/sysv/errfuns.h" +#ifdef __x86_64__ #define rdmsr(msr) \ ({ \ @@ -238,3 +239,5 @@ int arch_prctl(int code, int64_t addr) { #endif return rc; } + +#endif /* __x86_64__ */ diff --git a/libc/runtime/clone.c b/libc/runtime/clone.c index 1faea3ace..4ec9f3bdc 100644 --- a/libc/runtime/clone.c +++ b/libc/runtime/clone.c @@ -192,7 +192,7 @@ XnuThreadMain(void *pthread, // rdi "syscall\n\t" // __bsdthread_terminate() "ud2" : "=m"(*wt->ztid) - : "a"(0x2000000 | 361), "D"(0), "S"(0), "d"(0) + : "a"(0x2000000 | 361), "D"(0), "S"(0), "d"(0L) : "rcx", "r10", "r11", "memory"); notpossible; } diff --git a/libc/runtime/cosmo2.c b/libc/runtime/cosmo2.c index b51823a24..173d1df01 100644 --- a/libc/runtime/cosmo2.c +++ b/libc/runtime/cosmo2.c @@ -18,13 +18,13 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/syscall-sysv.internal.h" #include "libc/dce.h" -#include "libc/intrin/kprintf.h" #include "libc/intrin/strace.internal.h" #include "libc/macros.internal.h" #include "libc/nexgen32e/rdtsc.h" #include "libc/runtime/internal.h" #include "libc/runtime/memtrack.internal.h" #include "libc/runtime/runtime.h" +#include "libc/runtime/syslib.internal.h" #include "libc/thread/thread.h" #include "libc/thread/tls.h" #ifndef __x86_64__ @@ -33,15 +33,27 @@ int main(int, char **, char **) __attribute__((__weak__)); typedef int init_f(int argc, char **argv, char **envp, unsigned long *auxv); +extern long syscon_start[]; +extern long syscon_end[]; +extern long syscon_linux[]; +extern long syscon_xnu[]; +extern long syscon_freebsd[]; +extern long syscon_openbsd[]; +extern long syscon_netbsd[]; +extern long syscon_windows[]; extern init_f __strace_init; +extern init_f *__preinit_array_start[] __attribute__((__weak__)); +extern init_f *__preinit_array_end[] __attribute__((__weak__)); extern init_f *__init_array_start[] __attribute__((__weak__)); extern init_f *__init_array_end[] __attribute__((__weak__)); extern pthread_mutex_t __mmi_lock_obj; +extern int hostos asm("__hostos"); -textstartup void cosmo(long *sp) { +textstartup void cosmo(long *sp, struct Syslib *m1) { int argc; init_f **fp; uintptr_t *pp; + long *mp, *magnums; char **argv, **envp; unsigned long *auxv; @@ -56,6 +68,20 @@ textstartup void cosmo(long *sp) { auxv = (unsigned long *)(sp + 1 + argc + 1); while (*auxv++) donothing; + // detect apple m1 environment + if ((__syslib = m1)) { + hostos = _HOSTXNU; + magnums = syscon_xnu; + } else { + hostos = _HOSTLINUX; + magnums = syscon_linux; + } + + // setup system magic numbers + for (mp = syscon_start; mp < syscon_end; ++mp) { + *mp = *magnums++; + } + // needed by kisdangerous() __oldstack = (intptr_t)sp; __pid = sys_getpid().ax; @@ -65,11 +91,6 @@ textstartup void cosmo(long *sp) { _mmi.p = _mmi.s; __mmi_lock_obj._type = PTHREAD_MUTEX_RECURSIVE; -#ifdef SYSDEBUG - // initialize --strace functionality - argc = __strace_init(argc, argv, envp, auxv); -#endif - #if 0 #if IsAsan() __asan_init(argc, argv, envp, auxv); @@ -89,6 +110,9 @@ textstartup void cosmo(long *sp) { // run initialization callbacks _init(); __enable_tls(); +#ifdef SYSDEBUG + argc = __strace_init(argc, argv, envp, auxv); +#endif for (fp = __init_array_end; fp-- > __init_array_start;) { (*fp)(argc, argv, envp, auxv); } diff --git a/libc/runtime/efimain.greg.c b/libc/runtime/efimain.greg.c index 547b24777..8081ab9be 100644 --- a/libc/runtime/efimain.greg.c +++ b/libc/runtime/efimain.greg.c @@ -174,14 +174,15 @@ __msabi noasan EFI_STATUS EfiMain(EFI_HANDLE ImageHandle, (0x7e000 - 0x79000 + sizeof(struct EfiArgs) + 4095) / 4096, &Address); Address = IMAGE_BASE_PHYSICAL; SystemTable->BootServices->AllocatePages( - AllocateAddress, EfiRuntimeServicesData, ((_end - _base) + 4095) / 4096, - &Address); + AllocateAddress, EfiRuntimeServicesData, + ((_end - __executable_start) + 4095) / 4096, &Address); mm = (struct mman *)0x0500; SystemTable->BootServices->SetMem(mm, sizeof(*mm), 0); SystemTable->BootServices->SetMem( (void *)0x79000, 0x7e000 - 0x79000 + sizeof(struct EfiArgs), 0); - SystemTable->BootServices->CopyMem((void *)IMAGE_BASE_PHYSICAL, _base, - _end - _base); + SystemTable->BootServices->CopyMem((void *)IMAGE_BASE_PHYSICAL, + __executable_start, + _end - __executable_start); /* * Converts UEFI shell arguments to argv. diff --git a/libc/runtime/efipostboot.S b/libc/runtime/efipostboot.S index 1ef27085d..9bd083e43 100644 --- a/libc/runtime/efipostboot.S +++ b/libc/runtime/efipostboot.S @@ -41,28 +41,28 @@ _EfiPostboot: mov %rdi,rMm mov %rdx,rArgc lea (rBane,%rcx),rArgv - mov $PHYSICAL(.Ltmpstk),%rax # switch to temporary stack - and $-16,%al # in physical space + mov $PHYSICAL(.Ltmpstk),%rax // switch to temporary stack + and $-16,%al // in physical space xchg %rax,%rsp - mov $PHYSICAL(0f),%eax # resume execution in copied - jmp *%rax # image -0: mov $EFER,%ecx # enable syscall/sysret & nx + mov $PHYSICAL(0f),%eax // resume execution in copied + jmp *%rax // image +0: mov $EFER,%ecx // enable syscall/sysret & nx rdmsr or $EFER_SCE|EFER_NXE,%eax wrmsr - mov %rsi,%cr3 # load new page table - add rBane,%rsp # we can now switch stack to - add rBane,rMm # negative address space - mov $1024*1024,%edx # set up virtual memory - mov $1024*1024+_end,%ecx # mapping - sub $_base,%ecx + mov %rsi,%cr3 // load new page table + add rBane,%rsp // we can now switch stack to + add rBane,rMm // negative address space + mov $1024*1024,%edx // set up virtual memory + mov $1024*1024+_end,%ecx // mapping + sub $__executable_start,%ecx call __map_phdrs - mov $1f,%eax # switch rip to virtual - jmp *%rax # address space + mov $1f,%eax // switch rip to virtual + jmp *%rax // address space 1: push $0x037f fldcw (%rsp) .weak _gdtr - lgdt _gdtr # switch to our own GDT + lgdt _gdtr // switch to our own GDT mov $GDT_LONG_DATA,%ax mov %ax,%ds mov %ax,%ss @@ -71,34 +71,34 @@ _EfiPostboot: mov %ax,%gs .weak ape_stack_vaddr .weak ape_stack_memsz - movabs $ape_stack_vaddr,%rsp # switch to final stack in - add $ape_stack_memsz,%rsp # virtual address space - movl $0,0x7b000 # unmap null 2mb + movabs $ape_stack_vaddr,%rsp // switch to final stack in + add $ape_stack_memsz,%rsp // virtual address space + movl $0,0x7b000 // unmap null 2mb mov rMm,%rdi - xor %esi,%esi # free up now-unused pages + xor %esi,%esi // free up now-unused pages xor %edx,%edx call __reclaim_boot_pages - push .Lenv0(%rip) # envp[0][0] + push .Lenv0(%rip) // envp[0][0] mov %rsp,%rbp - push $0 # auxv[1][1] - push $0 # auxv[1][0] + push $0 // auxv[1][1] + push $0 // auxv[1][0] mov (rArgv),%rax add rBane,%rax - push %rax # auxv[0][1] - push $31 # auxv[0][0] AT_EXECFN - push $0 # envp[1] - push %rbp # envp[0] - push $0 # argv[argc] NULL - lea -8(rArgv,rArgc,8),%rsi # push rest of argv, & - mov rArgc,%rcx # adjust pointers to point to - std # negative space + push %rax // auxv[0][1] + push $31 // auxv[0][0] AT_EXECFN + push $0 // envp[1] + push %rbp // envp[0] + push $0 // argv[argc] NULL + lea -8(rArgv,rArgc,8),%rsi // push rest of argv, & + mov rArgc,%rcx // adjust pointers to point to + std // negative space 2: lodsq add rBane,%rax push %rax loop 2b cld - push rArgc # argc - pushpop _HOSTMETAL,%rcx # sets __hostos in crt.S + push rArgc // argc + pushpop _HOSTMETAL,%rcx // sets __hostos in crt.S xor %ebp,%ebp xor %eax,%eax xor %ebx,%ebx @@ -124,3 +124,6 @@ _EfiPostboot: .space 0x1000 .Ltmpstk: .previous + + .weak __executable_start + .weak _end diff --git a/libc/runtime/enable_threads.c b/libc/runtime/enable_threads.c index bb3ccc9c8..d01b35953 100644 --- a/libc/runtime/enable_threads.c +++ b/libc/runtime/enable_threads.c @@ -53,9 +53,9 @@ static privileged dontinline void FixupLockNops(void) { * binary the offsets of all the instructions we need to change. */ for (int *p = __threadcalls_start; p < __threadcalls_end; ++p) { - _base[*p + 0] = 0x67; - _base[*p + 1] = 0x67; - _base[*p + 2] = 0xe8; + __executable_start[*p + 0] = 0x67; + __executable_start[*p + 1] = 0x67; + __executable_start[*p + 2] = 0xe8; } __morph_end(&mask); } diff --git a/libc/runtime/enable_tls.c b/libc/runtime/enable_tls.c index 50b8dd923..36b719455 100644 --- a/libc/runtime/enable_tls.c +++ b/libc/runtime/enable_tls.c @@ -58,6 +58,7 @@ _Alignas(TLS_ALIGNMENT) static char __static_tls[6016]; * * Here's the TLS memory layout on aarch64: * + * x28 * %tpidr_el0 * │ * │ _Thread_local @@ -82,7 +83,7 @@ _Alignas(TLS_ALIGNMENT) static char __static_tls[6016]; * can disable it as follows: * * int main() { - * __tls_enabled = false; + * __tls_enabled_set(false); * // do stuff * } * @@ -98,15 +99,15 @@ textstartup void __enable_tls(void) { // Here's the layout we're currently using: // - // .align PAGESIZE + // .balign PAGESIZE // _tdata_start: // .tdata // _tdata_size = . - _tdata_start - // .align PAGESIZE + // .balign PAGESIZE // _tbss_start: // _tdata_start + _tbss_offset: // .tbss - // .align TLS_ALIGNMENT + // .balign TLS_ALIGNMENT // _tbss_size = . - _tbss_start // _tbss_end: // _tbss_start + _tbss_size: @@ -219,5 +220,5 @@ textstartup void __enable_tls(void) { #endif // we are now allowed to use tls - __tls_enabled = true; + __tls_enabled_set(true); } diff --git a/libc/runtime/fork-nt.c b/libc/runtime/fork-nt.c index 9f09022fb..fed4583ee 100644 --- a/libc/runtime/fork-nt.c +++ b/libc/runtime/fork-nt.c @@ -97,7 +97,7 @@ static dontinline textwindows bool ForkIo2(int64_t h, void *buf, size_t n, bool32 (*fn)(), const char *sf, bool ischild) { ssize_t rc = ForkIo(h, buf, n, fn); - if (ischild) __tls_enabled = false; // prevent tls crash in kprintf + if (ischild) __tls_enabled_set(false); // prevent tls crash in kprintf NTTRACE("%s(%ld, %p, %'zu) → %'zd% m", sf, h, buf, n, rc); return rc != -1; } @@ -211,7 +211,7 @@ textwindows void WinMainForked(void) { kStartTsc = savetsc; __threaded = false; __tls_index = 0; - __tls_enabled = false; + __tls_enabled_set(false); // apply fixups and reapply memory protections _mmi.p = maps; @@ -352,7 +352,7 @@ textwindows int sys_fork_nt(uint32_t dwCreationFlags) { if (tib && _weaken(__set_tls) && _weaken(__morph_tls)) { _weaken(__set_tls)(tib); _weaken(__morph_tls)(); - __tls_enabled = true; + __tls_enabled_set(true); } if (threaded && !__threaded && _weaken(__enable_threads)) { _weaken(__enable_threads)(); diff --git a/libc/runtime/fork-sysv.c b/libc/runtime/fork-sysv.c index 5d5b8ba88..4d61e6490 100644 --- a/libc/runtime/fork-sysv.c +++ b/libc/runtime/fork-sysv.c @@ -18,6 +18,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/syscall-sysv.internal.h" #include "libc/dce.h" +#include "libc/runtime/syslib.internal.h" #include "libc/sysv/consts/sig.h" #include "libc/sysv/errfuns.h" @@ -38,27 +39,32 @@ int sys_fork(void) { #elif defined(__aarch64__) - if (IsLinux()) { - int flags = 17; // SIGCHLD; - void *child_stack = 0; - void *parent_tidptr = 0; - void *newtls = 0; - void *child_tidptr = 0; - register long r0 asm("x0") = (long)flags; - register long r1 asm("x1") = (long)child_stack; - register long r2 asm("x2") = (long)parent_tidptr; - register long r3 asm("x3") = (long)newtls; - register long r4 asm("x4") = (long)child_tidptr; - register long res_x0 asm("x0"); - asm volatile("mov\tx8,%1\n\t" - "svc\t0" - : "=r"(res_x0) - : "i"(220), "r"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4) - : "x8", "memory"); - return _sysret(res_x0); - } else { - return enosys(); + int flags = 17; // SIGCHLD + void *child_stack = 0; + void *parent_tidptr = 0; + void *newtls = 0; + void *child_tidptr = 0; + register long r0 asm("x0") = (long)flags; + register long r1 asm("x1") = (long)child_stack; + register long r2 asm("x2") = (long)parent_tidptr; + register long r3 asm("x3") = (long)newtls; + register long r4 asm("x4") = (long)child_tidptr; + register int res_x0 asm("x0"); + register int res_x1 asm("x1"); + asm volatile("mov\tx8,%2\n\t" + "mov\tx16,%3\n\t" + "svc\t0" + : "=r"(res_x0), "=r"(res_x1) + : "i"(220), "i"(2), "r"(r0), "r"(r1), "r"(r2), "r"(r3), "r"(r4) + : "x8", "x16", "memory"); + if (IsXnu() && res_x0 != -1) { + res_x0 &= res_x1 - 1; } + return _sysret(res_x0); + +#else + + return enosys(); #endif } diff --git a/libc/runtime/internal.h b/libc/runtime/internal.h index d2e651acc..6e52a8cb9 100644 --- a/libc/runtime/internal.h +++ b/libc/runtime/internal.h @@ -18,15 +18,15 @@ extern const char v_ntsubsystem[] __attribute__((__weak__)); extern const uintptr_t __fini_array_end[] __attribute__((__weak__)); extern const uintptr_t __fini_array_start[] __attribute__((__weak__)); -extern unsigned char _tdata_start[]; -extern unsigned char _tdata_end[]; -extern unsigned char _tdata_size[]; -extern unsigned char _tbss_start[]; -extern unsigned char _tbss_end[]; -extern unsigned char _tbss_size[]; -extern unsigned char _tbss_offset[]; -extern unsigned char _tls_size[]; -extern unsigned char _tls_content[]; +extern unsigned char _tdata_start[] __attribute__((__weak__)); +extern unsigned char _tdata_end[] __attribute__((__weak__)); +extern unsigned char _tdata_size[] __attribute__((__weak__)); +extern unsigned char _tbss_start[] __attribute__((__weak__)); +extern unsigned char _tbss_end[] __attribute__((__weak__)); +extern unsigned char _tbss_size[] __attribute__((__weak__)); +extern unsigned char _tbss_offset[] __attribute__((__weak__)); +extern unsigned char _tls_size[] __attribute__((__weak__)); +extern unsigned char _tls_content[] __attribute__((__weak__)); void _init(void) _Hide; void __morph_tls(void); @@ -44,8 +44,7 @@ int GetDosEnviron(const char16_t *, char *, size_t, char **, size_t); bool __intercept_flag(int *, char *[], const char *); int sys_mprotect_nt(void *, size_t, int) _Hide; int __inflate(void *, size_t, const void *, size_t); -noasan void *_Mmap(void *addr, size_t size, int prot, int flags, int fd, - int64_t off) _Hide; +noasan void *_Mmap(void *, size_t, int, int, int, int64_t) _Hide; noasan int _Munmap(char *, size_t) _Hide; void InitializeFileDescriptors(void); void __on_arithmetic_overflow(void); diff --git a/libc/runtime/memtrack.internal.h b/libc/runtime/memtrack.internal.h index 1d1da1c20..fdff38aeb 100644 --- a/libc/runtime/memtrack.internal.h +++ b/libc/runtime/memtrack.internal.h @@ -126,18 +126,16 @@ forceinline pureconst bool IsOldStack(const void *x) { /* openbsd uses 4mb stack by default */ /* freebsd uses 512mb stack by default */ /* most systems use 8mb stack by default */ - size_t foss_stack_size = 4ul * 1024 * 1024; - uintptr_t top = ROUNDUP(__oldstack, FRAMESIZE); - uintptr_t bot = top - foss_stack_size; - uintptr_t old = ROUNDDOWN(__oldstack, foss_stack_size); + size_t foss_stack_size = 1ul * 1024 * 1024; + uintptr_t top = ROUNDUP(__oldstack + 1, foss_stack_size); + uintptr_t bot = ROUNDDOWN(__oldstack, foss_stack_size); return bot <= (uintptr_t)x && (uintptr_t)x < top; } forceinline pureconst bool IsOldStackFrame(int x) { - size_t foss_stack_size = 4ul * 1024 * 1024; - uintptr_t top = ROUNDUP(__oldstack, FRAMESIZE); - uintptr_t bot = top - foss_stack_size; - uintptr_t old = ROUNDDOWN(__oldstack, foss_stack_size); + size_t foss_stack_size = 1ul * 1024 * 1024; + uintptr_t top = ROUNDUP(__oldstack + 1, foss_stack_size); + uintptr_t bot = ROUNDDOWN(__oldstack, foss_stack_size); return (int)(bot >> 16) <= x && x <= (int)((top >> 16) - 1); } @@ -151,7 +149,7 @@ forceinline pureconst bool OverlapsImageSpace(const void *p, size_t n) { if (n) { BegA = p; EndA = BegA + (n - 1); - BegB = _base; + BegB = __executable_start; EndB = _end - 1; return MAX(BegA, BegB) < MIN(EndA, EndB); } else { diff --git a/libc/runtime/morph.greg.c b/libc/runtime/morph.greg.c index 3bba19d60..ec03efaa4 100644 --- a/libc/runtime/morph.greg.c +++ b/libc/runtime/morph.greg.c @@ -129,8 +129,8 @@ privileged void __morph_begin(sigset_t *save) { #else __morph_sigprocmask(SIG_BLOCK, &ss, save); #endif - __morph_mprotect(_base, __privileged_addr - _base, PROT_READ | PROT_WRITE, - kNtPageWritecopy); + __morph_mprotect(__executable_start, __privileged_addr - __executable_start, + PROT_READ | PROT_WRITE, kNtPageWritecopy); } /** @@ -140,8 +140,8 @@ privileged void __morph_end(sigset_t *save) { int ax; long dx; bool cf; - __morph_mprotect(_base, __privileged_addr - _base, PROT_READ | PROT_EXEC, - kNtPageExecuteRead); + __morph_mprotect(__executable_start, __privileged_addr - __executable_start, + PROT_READ | PROT_EXEC, kNtPageExecuteRead); #ifdef __x86_64__ if (IsOpenbsd()) { asm volatile(CFLAG_ASM("syscall") @@ -153,7 +153,7 @@ privileged void __morph_end(sigset_t *save) { asm volatile("mov\t$8,%%r10d\n\t" "syscall" : "=a"(ax), "=d"(dx) - : "0"(__NR_sigprocmask), "D"(SIG_SETMASK), "S"(save), "1"(0) + : "0"(__NR_sigprocmask), "D"(SIG_SETMASK), "S"(save), "1"(0L) : "rcx", "r8", "r9", "r10", "r11", "memory", "cc"); _npassert(!ax); } diff --git a/libc/runtime/morph_tls.c b/libc/runtime/morph_tls.c index bcdbd3266..f364cdabf 100644 --- a/libc/runtime/morph_tls.c +++ b/libc/runtime/morph_tls.c @@ -19,6 +19,7 @@ #include "ape/sections.internal.h" #include "libc/dce.h" #include "libc/intrin/bits.h" +#include "libc/intrin/kprintf.h" #include "libc/runtime/internal.h" #include "libc/runtime/morph.h" #include "libc/thread/tls.h" @@ -44,7 +45,7 @@ privileged void __morph_tls(void) { // We check `_tls_content` which is generated by the linker script // since it lets us determine ahead of time if _Thread_local vars // have actually been linked into this program. - if ((intptr_t)_tls_content && (IsWindows() || IsXnu())) { + if (IsWindows() || IsXnu()) { int n; uint64_t w; sigset_t mask; diff --git a/libc/runtime/peekall.S b/libc/runtime/peekall.S index fedc62666..8e1a56c2e 100644 --- a/libc/runtime/peekall.S +++ b/libc/runtime/peekall.S @@ -22,7 +22,7 @@ // Loads all pages from program image into memory. _peekall: .leafprologue - ezlea _base,si + ezlea __executable_start,si ezlea _etext,cx add $0x1000,%rsi 0: xor (%rsi),%eax @@ -39,3 +39,7 @@ _peekall: jb 0b .leafepilogue .endfn _peekall,globl + + .weak __executable_start + .weak _etext + .weak _end diff --git a/libc/runtime/printargs.c b/libc/runtime/printargs.c index 43bc933c1..cd12219ee 100644 --- a/libc/runtime/printargs.c +++ b/libc/runtime/printargs.c @@ -233,7 +233,7 @@ textstartup void __printargs(const char *prologue) { "mov\t%%ebx,%1\n\t" "pop\t%%rbx" : "=a"(eax), "=rm"(ebx), "=c"(ecx), "=d"(edx) - : "0"(0x40000000), "2"(0)); + : "0"(0x40000000), "2"(0L)); PRINT(" Running inside %.4s%.4s%.4s (eax=%#x)", &ebx, &ecx, &edx, eax); } CPUID4_ITERATE(i, { @@ -272,9 +272,8 @@ textstartup void __printargs(const char *prologue) { if (X86_HAVE(LA57)) kprintf(" LA57"); if (X86_HAVE(FSGSBASE)) kprintf(" FSGSBASE"); #elif defined(__aarch64__) - PRINT(" AARCH64\n"); + PRINT(" AARCH64"); #endif - kprintf("\n"); PRINT(""); PRINT("FILE DESCRIPTORS"); @@ -366,21 +365,33 @@ textstartup void __printargs(const char *prologue) { PRINT(""); PRINT("RESOURCE LIMITS"); - for (i = 0; i < RLIM_NLIMITS; ++i) { + for (gotsome = i = 0; i < RLIM_NLIMITS; ++i) { if (!getrlimit(i, &rlim)) { char buf[20]; if (rlim.rlim_cur == RLIM_INFINITY) rlim.rlim_cur = -1; if (rlim.rlim_max == RLIM_INFINITY) rlim.rlim_max = -1; PRINT(" ☼ %-20s %,16ld %,16ld", (DescribeRlimitName)(buf, i), rlim.rlim_cur, rlim.rlim_max); + gotsome = true; } } + if (!gotsome) { + PRINT(" ☼ %s", "none"); + } + + PRINT(""); + PRINT("STACK"); + size_t foss_stack_size = 4ul * 1024 * 1024; + PRINT(" ☼ %p __oldstack top", ROUNDUP(__oldstack + 1, foss_stack_size)); + PRINT(" ☼ %p __oldstack ptr", __oldstack); + PRINT(" ☼ %p __oldstack bot", ROUNDDOWN(__oldstack, foss_stack_size)); + PRINT(" ☼ %p __builtin_frame_address(0)", __builtin_frame_address(0)); PRINT(""); PRINT("ARGUMENTS (%p)", __argv); if (*__argv) { for (i = 0; i < __argc; ++i) { - PRINT(" ☼ %s", __argv[i]); + PRINT(" ☼ %p %s", __argv[i], __argv[i]); } } else { PRINT(" none"); @@ -390,7 +401,7 @@ textstartup void __printargs(const char *prologue) { PRINT("ENVIRONMENT (%p)", __envp); if (*__envp) { for (env = __envp; *env; ++env) { - PRINT(" ☼ %s", *env); + PRINT(" ☼ %p %s", *env, *env); } } else { PRINT(" none"); @@ -403,9 +414,9 @@ textstartup void __printargs(const char *prologue) { for (auxp = __auxv; *auxp; auxp += 2) { if ((auxinfo = DescribeAuxv(auxp[0]))) { ksnprintf(u.path, sizeof(u.path), auxinfo->fmt, auxp[1]); - PRINT(" ☼ %16s[%4ld] = %s", auxinfo->name, auxp[0], u.path); + PRINT(" ☼ %p %16s[%4ld] = %s", auxp, auxinfo->name, auxp[0], u.path); } else { - PRINT(" ☼ %16s[%4ld] = %014p", "unknown", auxp[0], auxp[1]); + PRINT(" ☼ %p %16s[%4ld] = %014p", auxp, "unknown", auxp[0], auxp[1]); } } } diff --git a/libc/runtime/runtime.mk b/libc/runtime/runtime.mk index ac403ea99..5581cb04a 100644 --- a/libc/runtime/runtime.mk +++ b/libc/runtime/runtime.mk @@ -64,6 +64,9 @@ $(LIBC_RUNTIME_A).pkg: \ # asan and ubsan can be function traced # we can't use function tracing because: # this is the function tracing runtime +o/$(MODE)/libc/runtime/cosmo2.o: private \ + OVERRIDE_CFLAGS += -O0 + o/$(MODE)/libc/runtime/ftracer.o: private \ OVERRIDE_CFLAGS += \ -x-no-pg \ @@ -114,6 +117,13 @@ o//libc/runtime/opensymboltable.greg.o: private \ OVERRIDE_CFLAGS += \ -Os +ifeq ($(ARCH), aarch64) +o/$(MODE)/libc/runtime/mmap.o \ +o/$(MODE)/libc/runtime/enable_tls.o: private \ + OVERRIDE_CFLAGS += \ + -mcmodel=large +endif + # these assembly files are safe to build on aarch64 o/$(MODE)/libc/runtime/init.o: libc/runtime/init.S @$(COMPILE) -AOBJECTIFY.S $(OBJECTIFY.S) $(OUTPUT_OPTION) -c $< diff --git a/libc/runtime/set_tls.c b/libc/runtime/set_tls.c index f5224fd86..cb74e559f 100644 --- a/libc/runtime/set_tls.c +++ b/libc/runtime/set_tls.c @@ -18,11 +18,13 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/assert.h" #include "libc/calls/calls.h" +#include "libc/calls/syscall-sysv.internal.h" #include "libc/dce.h" #include "libc/errno.h" #include "libc/nexgen32e/msr.internal.h" #include "libc/nt/thread.h" #include "libc/thread/tls.h" +#include "libc/thread/tls2.h" int sys_set_tls(); @@ -59,6 +61,9 @@ textstartup void __set_tls(struct CosmoTib *tib) { "d"((uint32_t)(val >> 32))); } #else - asm volatile("msr\ttpidr_el0,%0" : /* no outputs */ : "r"(tib)); + asm volatile("mov\tx28,%0" : /* no outputs */ : "r"(tib)); + if (!IsXnu()) { + asm volatile("msr\ttpidr_el0,%0" : /* no outputs */ : "r"(tib)); + } #endif } diff --git a/libc/runtime/syslib.internal.h b/libc/runtime/syslib.internal.h new file mode 100644 index 000000000..e2877080e --- /dev/null +++ b/libc/runtime/syslib.internal.h @@ -0,0 +1,54 @@ +#ifndef COSMOPOLITAN_LIBC_RUNTIME_SYSLIB_H_ +#define COSMOPOLITAN_LIBC_RUNTIME_SYSLIB_H_ +#include "libc/calls/struct/iovec.h" +#include "libc/calls/struct/sigaction.h" +#include "libc/calls/struct/sigset.h" +#include "libc/calls/struct/timespec.h" +#include "libc/thread/thread.h" +#if !(__ASSEMBLER__ + __LINKER__ + 0) +COSMOPOLITAN_C_START_ + +#define SYSLIB_MAGIC ('s' | 'l' << 8 | 'i' << 16 | 'b' << 24) +#define SYSLIB_VERSION 0 + +struct Syslib { + int magic; + int version; + void (*exit)(int) wontreturn; + long (*fork)(void); + long (*read)(int, void *, size_t); + long (*pread)(int, void *, size_t, int64_t); + long (*readv)(int, const struct iovec *, int); + long (*write)(int, const void *, size_t); + long (*pwrite)(int, const void *, size_t, int64_t); + long (*writev)(int, const struct iovec *, int); + long (*openat)(int, const char *, int, ...); + long (*pipe)(int[2]); + long (*close)(int); + long (*clock_gettime)(int, struct timespec *); + long (*nanosleep)(const struct timespec *, struct timespec *); + long (*mmap)(void *, size_t, int, int, int, int64_t); + long (*sigaction)(int, const struct sigaction *restrict, + struct sigaction *restrict); + int (*pthread_jit_write_protect_supported_np)(void); + void (*pthread_jit_write_protect_np)(int); + void (*sys_icache_invalidate)(void *, size_t); + pthread_t (*pthread_self)(void); + int (*pthread_create)(pthread_t *, const pthread_attr_t *, void *(*)(void *), + void *); + int (*pthread_detach)(pthread_t); + int (*pthread_join)(pthread_t, void **); + void (*pthread_exit)(void *); + int (*pthread_kill)(pthread_t, int); + int (*pthread_sigmask)(int, const sigset_t *restrict, sigset_t *restrict); + int (*pthread_setname_np)(const char *); + int (*pthread_key_create)(pthread_key_t *, void (*)(void *)); + int (*pthread_setspecific)(pthread_key_t, const void *); + void *(*pthread_getspecific)(pthread_key_t); +}; + +extern struct Syslib *__syslib; + +COSMOPOLITAN_C_END_ +#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */ +#endif /* COSMOPOLITAN_LIBC_RUNTIME_SYSLIB_H_ */ diff --git a/libc/sock/sock.mk b/libc/sock/sock.mk index 2924c1878..4c5158d1a 100644 --- a/libc/sock/sock.mk +++ b/libc/sock/sock.mk @@ -57,6 +57,10 @@ $(LIBC_SOCK_A).pkg: \ $(LIBC_SOCK_A_OBJS) \ $(foreach x,$(LIBC_SOCK_A_DIRECTDEPS),$($(x)_A).pkg) +# these assembly files are safe to build on aarch64 +o/$(MODE)/libc/sock/sys_sendfile_xnu.o: libc/sock/sys_sendfile_xnu.S + @$(COMPILE) -AOBJECTIFY.S $(OBJECTIFY.S) $(OUTPUT_OPTION) -c $< + LIBC_SOCK_LIBS = $(foreach x,$(LIBC_SOCK_ARTIFACTS),$($(x))) LIBC_SOCK_SRCS = $(foreach x,$(LIBC_SOCK_ARTIFACTS),$($(x)_SRCS)) LIBC_SOCK_HDRS = $(foreach x,$(LIBC_SOCK_ARTIFACTS),$($(x)_HDRS)) diff --git a/libc/str/strlcat.c b/libc/str/strlcat.c index 47a1dd8cf..6b9e02d70 100644 --- a/libc/str/strlcat.c +++ b/libc/str/strlcat.c @@ -21,7 +21,7 @@ // $OpenBSD: strlcat.c,v 1.19 2019/01/25 00:19:25 millert Exp $ asm(".ident\t\"\\n\\n\ -strlcat (ISC)\\n\ +OpenBSD Strings (ISC)\\n\ Copyright (c) 1998, 2015 Todd C. Miller \""); asm(".include \"libc/disclaimer.inc\""); diff --git a/libc/str/strlcpy.c b/libc/str/strlcpy.c index 652fb3059..d7ed2c046 100644 --- a/libc/str/strlcpy.c +++ b/libc/str/strlcpy.c @@ -1,7 +1,7 @@ -/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ -│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +/*-*- mode:c;indent-tabs-mode:t;c-basic-offset:8;tab-width:8;coding:utf-8 -*-│ +│vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╞══════════════════════════════════════════════════════════════════════════════╡ -│ Copyright 2020 Justine Alexandra Roberts Tunney │ +│ Copyright (c) 1998, 2015 Todd C. Miller │ │ │ │ Permission to use, copy, modify, and/or distribute this software for │ │ any purpose with or without fee is hereby granted, provided that the │ @@ -16,27 +16,43 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/intrin/safemacros.internal.h" -#include "libc/macros.internal.h" #include "libc/str/str.h" +// clang-format off +// $OpenBSD: strlcpy.c,v 1.16 2019/01/25 00:19:25 millert Exp $ + +asm(".ident\t\"\\n\\n\ +OpenBSD Strings (ISC)\\n\ +Copyright (c) 1998, 2015 Todd C. Miller \""); +asm(".include \"libc/disclaimer.inc\""); /** * Copies string, the BSD way. * - * @param d is buffer which needn't be initialized - * @param s is a NUL-terminated string - * @param n is byte capacity of d - * @return strlen(s) - * @note d and s can't overlap - * @note we prefer memccpy() + * Copy string src to buffer `dst` of size `dsize`. At most `dsize-1` + * chars will be copied. Always NUL terminates (unless `dsize == 0`). + * Returns `strlen(src)`; if `retval >= dsize`, truncation occurred. */ -size_t strlcpy(char *d, const char *s, size_t n) { - size_t slen, actual; - slen = strlen(s); - if (n) { - actual = MIN(n - 1, slen); - memcpy(d, s, actual); - d[actual] = '\0'; - } - return slen; +size_t +strlcpy(char *dst, const char *src, size_t dsize) +{ + const char *osrc = src; + size_t nleft = dsize; + + /* Copy as many bytes as will fit. */ + if (nleft != 0) { + while (--nleft != 0) { + if ((*dst++ = *src++) == '\0') + break; + } + } + + /* Not enough room in dst, add NUL and traverse rest of src. */ + if (nleft == 0) { + if (dsize != 0) + *dst = '\0'; /* NUL-terminate dst */ + while (*src++) + ; + } + + return(src - osrc - 1); /* count does not include NUL */ } diff --git a/libc/stubs/ld.S b/libc/stubs/ld.S deleted file mode 100644 index 8f314a192..000000000 --- a/libc/stubs/ld.S +++ /dev/null @@ -1,117 +0,0 @@ -/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│ -│vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi│ -╞══════════════════════════════════════════════════════════════════════════════╡ -│ Copyright 2020 Justine Alexandra Roberts Tunney │ -│ │ -│ Permission to use, copy, modify, and/or distribute this software for │ -│ any purpose with or without fee is hereby granted, provided that the │ -│ above copyright notice and this permission notice appear in all copies. │ -│ │ -│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ -│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ -│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ -│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ -│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ -│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ -│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ -│ PERFORMANCE OF THIS SOFTWARE. │ -╚─────────────────────────────────────────────────────────────────────────────*/ - -// Traditional executable boundaries defined by linker. -// @see man etext - _etext = 0 - _edata = 0 - _end = 0 - -// Cosmopolitan executable boundaries defined by linker script. -// @see libc/elf/elf.lds -// @see ape/ape.lds - _base = 0 - ape_xlm = 0 - _ehead = 0 - _ezip = 0 - _ereal = 0 - __privileged_start = 0 - __privileged_end = 0 - __privileged_addr = 0 - __privileged_size = 0 - __test_start = 0 - __ro = 0 - __relo_start = 0 - __relo_end = 0 - __data_start = 0 - __data_end = 0 - __bss_start = 0 - __bss_end = 0 - -// Thread local boundaries defined by linker script -// @see ape/ape.lds - _tdata_start = 0 - _tdata_end = 0 - _tdata_size = 0 - _tbss_start = 0 - _tbss_end = 0 - _tbss_offset = 0 - _tbss_size = 0 - _tls_size = 0 - _tls_content = 0 - - .globl _base - .globl ape_xlm - .globl __relo_start - .globl __relo_end - .globl __privileged_size - .globl __privileged_addr - .globl __privileged_start - .globl __privileged_end - .globl __ro - .globl __test_start - .globl _edata - .globl _ehead - .globl _end - .globl _ezip - .globl _ereal - .globl _etext - .globl _tdata_start - .globl _tdata_end - .globl _tdata_size - .globl _tbss_start - .globl _tbss_end - .globl _tbss_size - .globl _tbss_offset - .globl _tls_size - .globl _tls_content - .globl __data_start - .globl __data_end - .globl __bss_start - .globl __bss_end - - .weak _base - .weak ape_xlm - .weak __relo_start - .weak __relo_end - .weak __privileged_size - .weak __privileged_addr - .weak __privileged_start - .weak __privileged_end - .weak __ro - .weak __test_start - .weak _edata - .weak _ehead - .weak _end - .weak _ezip - .weak _ereal - .weak _etext - .weak _tdata_start - .weak _tdata_end - .weak _tdata_size - .weak _tbss_start - .weak _tbss_end - .weak _tbss_size - .weak _tls_size - .weak _tls_content - .weak _tbss_offset - .weak __data_start - .weak __data_end - .weak __bss_start - .weak __bss_end diff --git a/libc/stubs/stubs.mk b/libc/stubs/stubs.mk index c4dee61b1..51be93c7a 100644 --- a/libc/stubs/stubs.mk +++ b/libc/stubs/stubs.mk @@ -43,8 +43,6 @@ $(LIBC_STUBS_A).pkg: \ $(foreach x,$(LIBC_STUBS_A_DIRECTDEPS),$($(x)_A).pkg) # these assembly files are safe to build on aarch64 -o/$(MODE)/libc/stubs/ld.o: libc/stubs/ld.S - @$(COMPILE) -AOBJECTIFY.S $(OBJECTIFY.S) $(OUTPUT_OPTION) -c $< o/$(MODE)/libc/stubs/abort.o: libc/stubs/abort.S @$(COMPILE) -AOBJECTIFY.S $(OBJECTIFY.S) $(OUTPUT_OPTION) -c $< diff --git a/libc/sysv/calls/__bsd_setegid.S b/libc/sysv/calls/__bsd_setegid.S index 95b416e23..951ceafd9 100644 --- a/libc/sysv/calls/__bsd_setegid.S +++ b/libc/sysv/calls/__bsd_setegid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __bsd_setegid,0xfff0b60b620b6fff,0xfff,globl,hidden +.scall __bsd_setegid,0xfff0b60b620b6fff,4095,182,globl,hidden diff --git a/libc/sysv/calls/__bsd_seteuid.S b/libc/sysv/calls/__bsd_seteuid.S index 53760cfd8..8d6230597 100644 --- a/libc/sysv/calls/__bsd_seteuid.S +++ b/libc/sysv/calls/__bsd_seteuid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __bsd_seteuid,0xfff0b70b720b7fff,0xfff,globl,hidden +.scall __bsd_seteuid,0xfff0b70b720b7fff,4095,183,globl,hidden diff --git a/libc/sysv/calls/__sys_accept.S b/libc/sysv/calls/__sys_accept.S index 3adac84e1..aea6f98da 100644 --- a/libc/sysv/calls/__sys_accept.S +++ b/libc/sysv/calls/__sys_accept.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_accept,0x81e81ea1d281e82b,0x0ca,globl,hidden +.scall __sys_accept,0x81e81ea1d281e82b,202,30,globl,hidden diff --git a/libc/sysv/calls/__sys_accept4.S b/libc/sysv/calls/__sys_accept4.S index 9a5ff1cc8..9f2da2e78 100644 --- a/libc/sysv/calls/__sys_accept4.S +++ b/libc/sysv/calls/__sys_accept4.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_accept4,0xfff85da1dffff920,0x0f2,globl,hidden +.scall __sys_accept4,0xfff85da1dffff920,242,4095,globl,hidden diff --git a/libc/sysv/calls/__sys_bind.S b/libc/sysv/calls/__sys_bind.S index c04a37706..610c6010f 100644 --- a/libc/sysv/calls/__sys_bind.S +++ b/libc/sysv/calls/__sys_bind.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_bind,0x0680680682068031,0x0c8,globl,hidden +.scall __sys_bind,0x0680680682068031,200,104,globl,hidden diff --git a/libc/sysv/calls/__sys_clock_nanosleep.S b/libc/sysv/calls/__sys_clock_nanosleep.S index 73b9cc406..eabb1b1a8 100644 --- a/libc/sysv/calls/__sys_clock_nanosleep.S +++ b/libc/sysv/calls/__sys_clock_nanosleep.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_clock_nanosleep,0x9ddfff8f4ffff8e6,0x073,globl,hidden +.scall __sys_clock_nanosleep,0x9ddfff8f4ffff8e6,115,4095,globl,hidden diff --git a/libc/sysv/calls/__sys_connect.S b/libc/sysv/calls/__sys_connect.S index 115770fa2..e93013fe7 100644 --- a/libc/sysv/calls/__sys_connect.S +++ b/libc/sysv/calls/__sys_connect.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_connect,0x862862862286282a,0x0cb,globl,hidden +.scall __sys_connect,0x862862862286282a,203,98,globl,hidden diff --git a/libc/sysv/calls/__sys_dup3.S b/libc/sysv/calls/__sys_dup3.S index d2ae60b7a..2460f0f18 100644 --- a/libc/sysv/calls/__sys_dup3.S +++ b/libc/sysv/calls/__sys_dup3.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_dup3,0x1c6066fffffff124,0x018,globl,hidden +.scall __sys_dup3,0x1c6066fffffff124,24,4095,globl,hidden diff --git a/libc/sysv/calls/__sys_execve.S b/libc/sysv/calls/__sys_execve.S index e92435b1e..f478c2ba6 100644 --- a/libc/sysv/calls/__sys_execve.S +++ b/libc/sysv/calls/__sys_execve.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_execve,0x03b03b03b203b03b,0x0dd,globl,hidden +.scall __sys_execve,0x03b03b03b203b03b,221,59,globl,hidden diff --git a/libc/sysv/calls/__sys_fcntl.S b/libc/sysv/calls/__sys_fcntl.S index b84727881..beaeaf0ea 100644 --- a/libc/sysv/calls/__sys_fcntl.S +++ b/libc/sysv/calls/__sys_fcntl.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_fcntl,0x05c05c05c205c048,0x019,globl,hidden +.scall __sys_fcntl,0x05c05c05c205c048,25,92,globl,hidden diff --git a/libc/sysv/calls/__sys_fcntl_cp.S b/libc/sysv/calls/__sys_fcntl_cp.S index 3c97ea209..51b916310 100644 --- a/libc/sysv/calls/__sys_fcntl_cp.S +++ b/libc/sysv/calls/__sys_fcntl_cp.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_fcntl_cp,0x85c85c85c285c848,0x019,globl,hidden +.scall __sys_fcntl_cp,0x85c85c85c285c848,25,92,globl,hidden diff --git a/libc/sysv/calls/__sys_fork.S b/libc/sysv/calls/__sys_fork.S index 1543bda2b..90bb3c098 100644 --- a/libc/sysv/calls/__sys_fork.S +++ b/libc/sysv/calls/__sys_fork.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_fork,0x0020020022002039,0xfff,globl,hidden +.scall __sys_fork,0x0020020022002039,4095,2,globl,hidden diff --git a/libc/sysv/calls/__sys_fstat.S b/libc/sysv/calls/__sys_fstat.S index f9ccb3ac5..f36dfc347 100644 --- a/libc/sysv/calls/__sys_fstat.S +++ b/libc/sysv/calls/__sys_fstat.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_fstat,0x1b80352272153005,0x050,globl,hidden +.scall __sys_fstat,0x1b80352272153005,80,339,globl,hidden diff --git a/libc/sysv/calls/__sys_fstatat.S b/libc/sysv/calls/__sys_fstatat.S index 3e88acc0c..8aa20f12b 100644 --- a/libc/sysv/calls/__sys_fstatat.S +++ b/libc/sysv/calls/__sys_fstatat.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_fstatat,0x1d202a22821d6106,0x04f,globl,hidden +.scall __sys_fstatat,0x1d202a22821d6106,79,470,globl,hidden diff --git a/libc/sysv/calls/__sys_getpeername.S b/libc/sysv/calls/__sys_getpeername.S index 6124d0ba1..c3779badb 100644 --- a/libc/sysv/calls/__sys_getpeername.S +++ b/libc/sysv/calls/__sys_getpeername.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_getpeername,0x01f01f08d201f034,0x0cd,globl,hidden +.scall __sys_getpeername,0x01f01f08d201f034,205,31,globl,hidden diff --git a/libc/sysv/calls/__sys_getrusage.S b/libc/sysv/calls/__sys_getrusage.S index 7a7eb0e13..1ad668b8b 100644 --- a/libc/sysv/calls/__sys_getrusage.S +++ b/libc/sysv/calls/__sys_getrusage.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_getrusage,0x1bd0130752075062,0x0a5,globl,hidden +.scall __sys_getrusage,0x1bd0130752075062,165,117,globl,hidden diff --git a/libc/sysv/calls/__sys_getsockname.S b/libc/sysv/calls/__sys_getsockname.S index 82b3be694..00968f853 100644 --- a/libc/sysv/calls/__sys_getsockname.S +++ b/libc/sysv/calls/__sys_getsockname.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_getsockname,0x0200200202020033,0x0cc,globl,hidden +.scall __sys_getsockname,0x0200200202020033,204,32,globl,hidden diff --git a/libc/sysv/calls/__sys_gettid.S b/libc/sysv/calls/__sys_gettid.S index 0d31f7b0f..c37984e13 100644 --- a/libc/sysv/calls/__sys_gettid.S +++ b/libc/sysv/calls/__sys_gettid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_gettid,0x13712b1b0101b0ba,0x0b2,globl,hidden +.scall __sys_gettid,0x13712b1b0101b0ba,178,27,globl,hidden diff --git a/libc/sysv/calls/__sys_lstat.S b/libc/sysv/calls/__sys_lstat.S index 1eb4787cd..9674166a8 100644 --- a/libc/sysv/calls/__sys_lstat.S +++ b/libc/sysv/calls/__sys_lstat.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_lstat,0x1b90280282154006,0xfff,globl,hidden +.scall __sys_lstat,0x1b90280282154006,4095,340,globl,hidden diff --git a/libc/sysv/calls/__sys_mmap.S b/libc/sysv/calls/__sys_mmap.S index 7fff6898d..b755700cb 100644 --- a/libc/sysv/calls/__sys_mmap.S +++ b/libc/sysv/calls/__sys_mmap.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_mmap,0x0c50c51dd20c5009,0x0de,globl,hidden +.scall __sys_mmap,0x0c50c51dd20c5009,222,197,globl,hidden diff --git a/libc/sysv/calls/__sys_mremap.S b/libc/sysv/calls/__sys_mremap.S index 0be9ddcf1..c6971f5d8 100644 --- a/libc/sysv/calls/__sys_mremap.S +++ b/libc/sysv/calls/__sys_mremap.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_mremap,0x19bffffffffff019,0x0d8,globl,hidden +.scall __sys_mremap,0x19bffffffffff019,216,4095,globl,hidden diff --git a/libc/sysv/calls/__sys_munmap.S b/libc/sysv/calls/__sys_munmap.S index eab255ad6..89b07e258 100644 --- a/libc/sysv/calls/__sys_munmap.S +++ b/libc/sysv/calls/__sys_munmap.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_munmap,0x049049049204900b,0x0d7,globl,hidden +.scall __sys_munmap,0x049049049204900b,215,73,globl,hidden diff --git a/libc/sysv/calls/__sys_openat.S b/libc/sysv/calls/__sys_openat.S index 010af310c..cc7ee2864 100644 --- a/libc/sysv/calls/__sys_openat.S +++ b/libc/sysv/calls/__sys_openat.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_openat,0x9d49419f329cf901,0x038,globl,hidden +.scall __sys_openat,0x9d49419f329cf901,56,463,globl,hidden diff --git a/libc/sysv/calls/__sys_openat_nc.S b/libc/sysv/calls/__sys_openat_nc.S index fd8bac06a..db6d7c9f6 100644 --- a/libc/sysv/calls/__sys_openat_nc.S +++ b/libc/sysv/calls/__sys_openat_nc.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_openat_nc,0x1d41411f321d0101,0x038,globl,hidden +.scall __sys_openat_nc,0x1d41411f321d0101,56,464,globl,hidden diff --git a/libc/sysv/calls/__sys_pipe.S b/libc/sysv/calls/__sys_pipe.S index e4acee8a2..9dcaec553 100644 --- a/libc/sysv/calls/__sys_pipe.S +++ b/libc/sysv/calls/__sys_pipe.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_pipe,0x02a10721e202a016,0x03b,globl,hidden +.scall __sys_pipe,0x02a10721e202a016,59,42,globl,hidden diff --git a/libc/sysv/calls/__sys_pipe2.S b/libc/sysv/calls/__sys_pipe2.S index 991cfeb5b..5029c3914 100644 --- a/libc/sysv/calls/__sys_pipe2.S +++ b/libc/sysv/calls/__sys_pipe2.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_pipe2,0x1c506521effff125,0x03b,globl,hidden +.scall __sys_pipe2,0x1c506521effff125,59,4095,globl,hidden diff --git a/libc/sysv/calls/__sys_poll.S b/libc/sysv/calls/__sys_poll.S index 4ec95bea9..b566b52cd 100644 --- a/libc/sysv/calls/__sys_poll.S +++ b/libc/sysv/calls/__sys_poll.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_poll,0x8d18fc8d128e6807,0xfff,globl,hidden +.scall __sys_poll,0x8d18fc8d128e6807,4095,230,globl,hidden diff --git a/libc/sysv/calls/__sys_ptrace.S b/libc/sysv/calls/__sys_ptrace.S index 6e654230a..45adb74cd 100644 --- a/libc/sysv/calls/__sys_ptrace.S +++ b/libc/sysv/calls/__sys_ptrace.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_ptrace,0x01a01a01a201a065,0x075,globl,hidden +.scall __sys_ptrace,0x01a01a01a201a065,117,26,globl,hidden diff --git a/libc/sysv/calls/__sys_sigprocmask.S b/libc/sysv/calls/__sys_sigprocmask.S index fa4365158..2ea7869ac 100644 --- a/libc/sysv/calls/__sys_sigprocmask.S +++ b/libc/sysv/calls/__sys_sigprocmask.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_sigprocmask,0x125030154214900e,0x087,globl,hidden +.scall __sys_sigprocmask,0x125030154214900e,135,329,globl,hidden diff --git a/libc/sysv/calls/__sys_socket.S b/libc/sysv/calls/__sys_socket.S index f80972bc7..bd1ed5eb7 100644 --- a/libc/sysv/calls/__sys_socket.S +++ b/libc/sysv/calls/__sys_socket.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_socket,0x18a0610612061029,0x0c6,globl,hidden +.scall __sys_socket,0x18a0610612061029,198,97,globl,hidden diff --git a/libc/sysv/calls/__sys_socketpair.S b/libc/sysv/calls/__sys_socketpair.S index f40c3002b..448381345 100644 --- a/libc/sysv/calls/__sys_socketpair.S +++ b/libc/sysv/calls/__sys_socketpair.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_socketpair,0x0870870872087035,0x0c7,globl,hidden +.scall __sys_socketpair,0x0870870872087035,199,135,globl,hidden diff --git a/libc/sysv/calls/__sys_stat.S b/libc/sysv/calls/__sys_stat.S index 05e3a82de..05f089935 100644 --- a/libc/sysv/calls/__sys_stat.S +++ b/libc/sysv/calls/__sys_stat.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_stat,0x1b7026fff2152004,0x04f,globl,hidden +.scall __sys_stat,0x1b7026fff2152004,79,338,globl,hidden diff --git a/libc/sysv/calls/__sys_utimensat.S b/libc/sysv/calls/__sys_utimensat.S index 1216e65cc..78a084571 100644 --- a/libc/sysv/calls/__sys_utimensat.S +++ b/libc/sysv/calls/__sys_utimensat.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_utimensat,0x1d3054223ffff118,0x058,globl,hidden +.scall __sys_utimensat,0x1d3054223ffff118,88,4095,globl,hidden diff --git a/libc/sysv/calls/__sys_wait4.S b/libc/sysv/calls/__sys_wait4.S index 259d63b81..2abc6cc30 100644 --- a/libc/sysv/calls/__sys_wait4.S +++ b/libc/sysv/calls/__sys_wait4.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall __sys_wait4,0x9c180b807280783d,0x104,globl,hidden +.scall __sys_wait4,0x9c180b807280783d,260,7,globl,hidden diff --git a/libc/sysv/calls/get_mempolicy.S b/libc/sysv/calls/get_mempolicy.S index cc35816eb..829845fd9 100644 --- a/libc/sysv/calls/get_mempolicy.S +++ b/libc/sysv/calls/get_mempolicy.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall get_mempolicy,0xfffffffffffff0ef,0x0ec,globl +.scall get_mempolicy,0xfffffffffffff0ef,236,4095,globl diff --git a/libc/sysv/calls/getpagesize_freebsd.S b/libc/sysv/calls/getpagesize_freebsd.S index 8c8dd2080..cdb1b78f7 100644 --- a/libc/sysv/calls/getpagesize_freebsd.S +++ b/libc/sysv/calls/getpagesize_freebsd.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall getpagesize_freebsd,0xffffff040fffffff,0xfff,globl,hidden +.scall getpagesize_freebsd,0xffffff040fffffff,4095,4095,globl,hidden diff --git a/libc/sysv/calls/ioprio_get.S b/libc/sysv/calls/ioprio_get.S index 0df3236b6..5e0110b91 100644 --- a/libc/sysv/calls/ioprio_get.S +++ b/libc/sysv/calls/ioprio_get.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall ioprio_get,0xfffffffffffff0fc,0x01f,globl +.scall ioprio_get,0xfffffffffffff0fc,31,4095,globl diff --git a/libc/sysv/calls/ioprio_set.S b/libc/sysv/calls/ioprio_set.S index 58b07d4bf..ff8c701ca 100644 --- a/libc/sysv/calls/ioprio_set.S +++ b/libc/sysv/calls/ioprio_set.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall ioprio_set,0xfffffffffffff0fb,0x01e,globl +.scall ioprio_set,0xfffffffffffff0fb,30,4095,globl diff --git a/libc/sysv/calls/posix_fallocate.S b/libc/sysv/calls/posix_fallocate.S index 879567fc6..5722f5ec9 100644 --- a/libc/sysv/calls/posix_fallocate.S +++ b/libc/sysv/calls/posix_fallocate.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall posix_fallocate,0x9dffffa12fffffff,0xfff,globl,hidden +.scall posix_fallocate,0x9dffffa12fffffff,4095,4095,globl,hidden diff --git a/libc/sysv/calls/set_mempolicy.S b/libc/sysv/calls/set_mempolicy.S index 468e4adba..dfa6970ea 100644 --- a/libc/sysv/calls/set_mempolicy.S +++ b/libc/sysv/calls/set_mempolicy.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall set_mempolicy,0xfffffffffffff0ee,0x0ed,globl +.scall set_mempolicy,0xfffffffffffff0ee,237,4095,globl diff --git a/libc/sysv/calls/sys_acct.S b/libc/sysv/calls/sys_acct.S index ec947135a..63346d014 100644 --- a/libc/sysv/calls/sys_acct.S +++ b/libc/sysv/calls/sys_acct.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_acct,0x03303303320330a3,0x059,globl +.scall sys_acct,0x03303303320330a3,89,51,globl diff --git a/libc/sysv/calls/sys_add_key.S b/libc/sysv/calls/sys_add_key.S index ebe4f3fe9..f779b41bc 100644 --- a/libc/sysv/calls/sys_add_key.S +++ b/libc/sysv/calls/sys_add_key.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_add_key,0xfffffffffffff0f8,0x0d9,globl +.scall sys_add_key,0xfffffffffffff0f8,217,4095,globl diff --git a/libc/sysv/calls/sys_adjtime.S b/libc/sysv/calls/sys_adjtime.S index 5d7e3899f..ceef1298e 100644 --- a/libc/sysv/calls/sys_adjtime.S +++ b/libc/sysv/calls/sys_adjtime.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_adjtime,0x1a508c08c208cfff,0xfff,globl +.scall sys_adjtime,0x1a508c08c208cfff,4095,140,globl diff --git a/libc/sysv/calls/sys_adjtimex.S b/libc/sysv/calls/sys_adjtimex.S index e425ba990..220ad8545 100644 --- a/libc/sysv/calls/sys_adjtimex.S +++ b/libc/sysv/calls/sys_adjtimex.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_adjtimex,0xfffffffffffff09f,0x0ab,globl +.scall sys_adjtimex,0xfffffffffffff09f,171,4095,globl diff --git a/libc/sysv/calls/sys_aio_cancel.S b/libc/sysv/calls/sys_aio_cancel.S index 75b1a5261..4774b2fb0 100644 --- a/libc/sysv/calls/sys_aio_cancel.S +++ b/libc/sysv/calls/sys_aio_cancel.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_aio_cancel,0x18ffff13c213cfff,0xfff,globl +.scall sys_aio_cancel,0x18ffff13c213cfff,4095,316,globl diff --git a/libc/sysv/calls/sys_aio_error.S b/libc/sysv/calls/sys_aio_error.S index 1cf0f0219..b58e5e213 100644 --- a/libc/sysv/calls/sys_aio_error.S +++ b/libc/sysv/calls/sys_aio_error.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_aio_error,0x190fff13d213dfff,0xfff,globl +.scall sys_aio_error,0x190fff13d213dfff,4095,317,globl diff --git a/libc/sysv/calls/sys_aio_fsync.S b/libc/sysv/calls/sys_aio_fsync.S index 76684833e..6556d7162 100644 --- a/libc/sysv/calls/sys_aio_fsync.S +++ b/libc/sysv/calls/sys_aio_fsync.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_aio_fsync,0x191fff1d12139fff,0xfff,globl +.scall sys_aio_fsync,0x191fff1d12139fff,4095,313,globl diff --git a/libc/sysv/calls/sys_aio_mlock.S b/libc/sysv/calls/sys_aio_mlock.S index 8818dd609..2d5484246 100644 --- a/libc/sysv/calls/sys_aio_mlock.S +++ b/libc/sysv/calls/sys_aio_mlock.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_aio_mlock,0xffffff21ffffffff,0xfff,globl +.scall sys_aio_mlock,0xffffff21ffffffff,4095,4095,globl diff --git a/libc/sysv/calls/sys_aio_read.S b/libc/sysv/calls/sys_aio_read.S index 77e783293..ccfec9233 100644 --- a/libc/sysv/calls/sys_aio_read.S +++ b/libc/sysv/calls/sys_aio_read.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_aio_read,0x192fff13e213efff,0xfff,globl +.scall sys_aio_read,0x192fff13e213efff,4095,318,globl diff --git a/libc/sysv/calls/sys_aio_return.S b/libc/sysv/calls/sys_aio_return.S index 419dc445f..9a31dd7c8 100644 --- a/libc/sysv/calls/sys_aio_return.S +++ b/libc/sysv/calls/sys_aio_return.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_aio_return,0x193fff13a213afff,0xfff,globl +.scall sys_aio_return,0x193fff13a213afff,4095,314,globl diff --git a/libc/sysv/calls/sys_aio_suspend.S b/libc/sysv/calls/sys_aio_suspend.S index 7ad598b6d..ae2141bf8 100644 --- a/libc/sysv/calls/sys_aio_suspend.S +++ b/libc/sysv/calls/sys_aio_suspend.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_aio_suspend,0x1b6fff13b213bfff,0xfff,globl +.scall sys_aio_suspend,0x1b6fff13b213bfff,4095,315,globl diff --git a/libc/sysv/calls/sys_aio_suspend_nocancel.S b/libc/sysv/calls/sys_aio_suspend_nocancel.S index 93d64504a..0808ba6dd 100644 --- a/libc/sysv/calls/sys_aio_suspend_nocancel.S +++ b/libc/sysv/calls/sys_aio_suspend_nocancel.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_aio_suspend_nocancel,0xfffffffff21a5fff,0xfff,globl +.scall sys_aio_suspend_nocancel,0xfffffffff21a5fff,4095,421,globl diff --git a/libc/sysv/calls/sys_aio_waitcomplete.S b/libc/sysv/calls/sys_aio_waitcomplete.S index ba554c2ad..1b17a7488 100644 --- a/libc/sysv/calls/sys_aio_waitcomplete.S +++ b/libc/sysv/calls/sys_aio_waitcomplete.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_aio_waitcomplete,0xffffff167fffffff,0xfff,globl +.scall sys_aio_waitcomplete,0xffffff167fffffff,4095,4095,globl diff --git a/libc/sysv/calls/sys_aio_write.S b/libc/sysv/calls/sys_aio_write.S index 037578ff6..97de8c11c 100644 --- a/libc/sysv/calls/sys_aio_write.S +++ b/libc/sysv/calls/sys_aio_write.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_aio_write,0x195fff13f213ffff,0xfff,globl +.scall sys_aio_write,0x195fff13f213ffff,4095,319,globl diff --git a/libc/sysv/calls/sys_alarm.S b/libc/sysv/calls/sys_alarm.S index b41206b9d..13a5f2574 100644 --- a/libc/sysv/calls/sys_alarm.S +++ b/libc/sysv/calls/sys_alarm.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_alarm,0xfffffffffffff025,0xfff,globl,hidden +.scall sys_alarm,0xfffffffffffff025,4095,4095,globl,hidden diff --git a/libc/sysv/calls/sys_arch_prctl.S b/libc/sysv/calls/sys_arch_prctl.S index 2e7ff9cfb..891f1ca7a 100644 --- a/libc/sysv/calls/sys_arch_prctl.S +++ b/libc/sysv/calls/sys_arch_prctl.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_arch_prctl,0x0a50a50a5ffff09e,0xfff,globl,hidden +.scall sys_arch_prctl,0x0a50a50a5ffff09e,4095,4095,globl,hidden diff --git a/libc/sysv/calls/sys_audit.S b/libc/sysv/calls/sys_audit.S index 51040f6de..6be039bbb 100644 --- a/libc/sysv/calls/sys_audit.S +++ b/libc/sysv/calls/sys_audit.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_audit,0xffffff1bd215efff,0xfff,globl +.scall sys_audit,0xffffff1bd215efff,4095,350,globl diff --git a/libc/sysv/calls/sys_auditctl.S b/libc/sysv/calls/sys_auditctl.S index cca6b4969..6a851fc9e 100644 --- a/libc/sysv/calls/sys_auditctl.S +++ b/libc/sysv/calls/sys_auditctl.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_auditctl,0xffffff1c52167fff,0xfff,globl +.scall sys_auditctl,0xffffff1c52167fff,4095,359,globl diff --git a/libc/sysv/calls/sys_auditon.S b/libc/sysv/calls/sys_auditon.S index 70de5d553..bd6477d56 100644 --- a/libc/sysv/calls/sys_auditon.S +++ b/libc/sysv/calls/sys_auditon.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_auditon,0xffffff1be215ffff,0xfff,globl +.scall sys_auditon,0xffffff1be215ffff,4095,351,globl diff --git a/libc/sysv/calls/sys_bogus.S b/libc/sysv/calls/sys_bogus.S index c4e3998f2..128f7a786 100644 --- a/libc/sysv/calls/sys_bogus.S +++ b/libc/sysv/calls/sys_bogus.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_bogus,0x00b5005002500500,0xfff,globl +.scall sys_bogus,0x00b5005002500500,4095,1280,globl diff --git a/libc/sysv/calls/sys_bpf.S b/libc/sysv/calls/sys_bpf.S index 2d78ed2e4..ffe55f0c6 100644 --- a/libc/sysv/calls/sys_bpf.S +++ b/libc/sysv/calls/sys_bpf.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_bpf,0xfffffffffffff141,0x118,globl +.scall sys_bpf,0xfffffffffffff141,280,4095,globl diff --git a/libc/sysv/calls/sys_bsdthread_register.S b/libc/sysv/calls/sys_bsdthread_register.S index 241718b28..addbd15b7 100644 --- a/libc/sysv/calls/sys_bsdthread_register.S +++ b/libc/sysv/calls/sys_bsdthread_register.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_bsdthread_register,0xfffffffff216efff,0xfff,globl,hidden +.scall sys_bsdthread_register,0xfffffffff216efff,4095,366,globl,hidden diff --git a/libc/sysv/calls/sys_capget.S b/libc/sysv/calls/sys_capget.S index df580236f..170520e9f 100644 --- a/libc/sysv/calls/sys_capget.S +++ b/libc/sysv/calls/sys_capget.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_capget,0xfffffffffffff07d,0x05a,globl +.scall sys_capget,0xfffffffffffff07d,90,4095,globl diff --git a/libc/sysv/calls/sys_capset.S b/libc/sysv/calls/sys_capset.S index 33da63b8d..c93912ad3 100644 --- a/libc/sysv/calls/sys_capset.S +++ b/libc/sysv/calls/sys_capset.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_capset,0xfffffffffffff07e,0x05b,globl +.scall sys_capset,0xfffffffffffff07e,91,4095,globl diff --git a/libc/sysv/calls/sys_chdir.S b/libc/sysv/calls/sys_chdir.S index 5036f3fc6..e21921b9b 100644 --- a/libc/sysv/calls/sys_chdir.S +++ b/libc/sysv/calls/sys_chdir.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_chdir,0x00c00c00c200c050,0x031,globl,hidden +.scall sys_chdir,0x00c00c00c200c050,49,12,globl,hidden diff --git a/libc/sysv/calls/sys_chflags.S b/libc/sysv/calls/sys_chflags.S index 605ee06df..a51e7fce9 100644 --- a/libc/sysv/calls/sys_chflags.S +++ b/libc/sysv/calls/sys_chflags.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_chflags,0x0220220222022fff,0xfff,globl +.scall sys_chflags,0x0220220222022fff,4095,34,globl diff --git a/libc/sysv/calls/sys_chflagsat.S b/libc/sysv/calls/sys_chflagsat.S index 4363fc4a9..5aba8d6d0 100644 --- a/libc/sysv/calls/sys_chflagsat.S +++ b/libc/sysv/calls/sys_chflagsat.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_chflagsat,0xfff06b21cfffffff,0xfff,globl +.scall sys_chflagsat,0xfff06b21cfffffff,4095,4095,globl diff --git a/libc/sysv/calls/sys_chroot.S b/libc/sysv/calls/sys_chroot.S index 6120abd18..8b492751f 100644 --- a/libc/sysv/calls/sys_chroot.S +++ b/libc/sysv/calls/sys_chroot.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_chroot,0x03d03d03d203d0a1,0x033,globl,hidden +.scall sys_chroot,0x03d03d03d203d0a1,51,61,globl,hidden diff --git a/libc/sysv/calls/sys_clock_adjtime.S b/libc/sysv/calls/sys_clock_adjtime.S index 564706b56..337d0a6e8 100644 --- a/libc/sysv/calls/sys_clock_adjtime.S +++ b/libc/sysv/calls/sys_clock_adjtime.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_clock_adjtime,0xfffffffffffff131,0x10a,globl +.scall sys_clock_adjtime,0xfffffffffffff131,266,4095,globl diff --git a/libc/sysv/calls/sys_clock_getres.S b/libc/sysv/calls/sys_clock_getres.S index a6a7fc5be..7a3549517 100644 --- a/libc/sysv/calls/sys_clock_getres.S +++ b/libc/sysv/calls/sys_clock_getres.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_clock_getres,0x1ad0590eaffff0e5,0x072,globl,hidden +.scall sys_clock_getres,0x1ad0590eaffff0e5,114,4095,globl,hidden diff --git a/libc/sysv/calls/sys_clock_gettime.S b/libc/sysv/calls/sys_clock_gettime.S index b748b2581..42653a63f 100644 --- a/libc/sysv/calls/sys_clock_gettime.S +++ b/libc/sysv/calls/sys_clock_gettime.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_clock_gettime,0x1ab0570e8ffff0e4,0x071,globl,hidden +.scall sys_clock_gettime,0x1ab0570e8ffff0e4,113,4095,globl,hidden diff --git a/libc/sysv/calls/sys_clock_settime.S b/libc/sysv/calls/sys_clock_settime.S index 2cc2c8dcf..4df6ac818 100644 --- a/libc/sysv/calls/sys_clock_settime.S +++ b/libc/sysv/calls/sys_clock_settime.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_clock_settime,0x1ac0580e9ffff0e3,0x070,globl +.scall sys_clock_settime,0x1ac0580e9ffff0e3,112,4095,globl diff --git a/libc/sysv/calls/sys_clone.S b/libc/sysv/calls/sys_clone.S index 7106cc07e..cebf14a03 100644 --- a/libc/sysv/calls/sys_clone.S +++ b/libc/sysv/calls/sys_clone.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_clone,0x11fffffffffff038,0x0dc,globl,hidden +.scall sys_clone,0x11fffffffffff038,220,4095,globl,hidden diff --git a/libc/sysv/calls/sys_clone3.S b/libc/sysv/calls/sys_clone3.S index c4aa6b258..11b6f43e2 100644 --- a/libc/sysv/calls/sys_clone3.S +++ b/libc/sysv/calls/sys_clone3.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_clone3,0xfffffffffffff1b3,0x1b3,globl +.scall sys_clone3,0xfffffffffffff1b3,435,4095,globl diff --git a/libc/sysv/calls/sys_close.S b/libc/sysv/calls/sys_close.S index 317167ffe..fffe18349 100644 --- a/libc/sysv/calls/sys_close.S +++ b/libc/sysv/calls/sys_close.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_close,0x0060060062006003,0x039,globl,hidden +.scall sys_close,0x0060060062006003,57,6,globl,hidden diff --git a/libc/sysv/calls/sys_close_range.S b/libc/sysv/calls/sys_close_range.S index c20752c61..4c941e6a7 100644 --- a/libc/sysv/calls/sys_close_range.S +++ b/libc/sysv/calls/sys_close_range.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_close_range,0xffffff23fffff1b4,0x1b4,globl,hidden +.scall sys_close_range,0xffffff23fffff1b4,436,4095,globl,hidden diff --git a/libc/sysv/calls/sys_closefrom.S b/libc/sysv/calls/sys_closefrom.S index a01a8b014..451000e54 100644 --- a/libc/sysv/calls/sys_closefrom.S +++ b/libc/sysv/calls/sys_closefrom.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_closefrom,0xfff11f1fdfffffff,0xfff,globl,hidden +.scall sys_closefrom,0xfff11f1fdfffffff,4095,4095,globl,hidden diff --git a/libc/sysv/calls/sys_copy_file_range.S b/libc/sysv/calls/sys_copy_file_range.S index 6600b361b..07ceac3b6 100644 --- a/libc/sysv/calls/sys_copy_file_range.S +++ b/libc/sysv/calls/sys_copy_file_range.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_copy_file_range,0xffffffa39ffff946,0x11d,globl,hidden +.scall sys_copy_file_range,0xffffffa39ffff946,285,4095,globl,hidden diff --git a/libc/sysv/calls/sys_delete_module.S b/libc/sysv/calls/sys_delete_module.S index 9f83bf871..00d0d1fa1 100644 --- a/libc/sysv/calls/sys_delete_module.S +++ b/libc/sysv/calls/sys_delete_module.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_delete_module,0xfffffffffffff0b0,0x06a,globl +.scall sys_delete_module,0xfffffffffffff0b0,106,4095,globl diff --git a/libc/sysv/calls/sys_dup.S b/libc/sysv/calls/sys_dup.S index 217a8697e..1f0150523 100644 --- a/libc/sysv/calls/sys_dup.S +++ b/libc/sysv/calls/sys_dup.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_dup,0x0290290292029020,0x017,globl,hidden +.scall sys_dup,0x0290290292029020,23,41,globl,hidden diff --git a/libc/sysv/calls/sys_dup2.S b/libc/sysv/calls/sys_dup2.S index 52bbb0efd..f1c23f8c9 100644 --- a/libc/sysv/calls/sys_dup2.S +++ b/libc/sysv/calls/sys_dup2.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_dup2,0x05a05a05a205a021,0x018,globl,hidden +.scall sys_dup2,0x05a05a05a205a021,24,90,globl,hidden diff --git a/libc/sysv/calls/sys_epoll_create.S b/libc/sysv/calls/sys_epoll_create.S index 27cc3f18f..933be8b1f 100644 --- a/libc/sysv/calls/sys_epoll_create.S +++ b/libc/sysv/calls/sys_epoll_create.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_epoll_create,0xfffffffffffff0d5,0xfff,globl,hidden +.scall sys_epoll_create,0xfffffffffffff0d5,4095,4095,globl,hidden diff --git a/libc/sysv/calls/sys_epoll_create1.S b/libc/sysv/calls/sys_epoll_create1.S index f39293414..3eac66c30 100644 --- a/libc/sysv/calls/sys_epoll_create1.S +++ b/libc/sysv/calls/sys_epoll_create1.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_epoll_create1,0xfffffffffffff123,0x014,globl,hidden +.scall sys_epoll_create1,0xfffffffffffff123,20,4095,globl,hidden diff --git a/libc/sysv/calls/sys_epoll_ctl.S b/libc/sysv/calls/sys_epoll_ctl.S index b21ba3291..7e32808a5 100644 --- a/libc/sysv/calls/sys_epoll_ctl.S +++ b/libc/sysv/calls/sys_epoll_ctl.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_epoll_ctl,0xfffffffffffff0e9,0x015,globl,hidden +.scall sys_epoll_ctl,0xfffffffffffff0e9,21,4095,globl,hidden diff --git a/libc/sysv/calls/sys_epoll_pwait.S b/libc/sysv/calls/sys_epoll_pwait.S index b159f81c4..9d18029f5 100644 --- a/libc/sysv/calls/sys_epoll_pwait.S +++ b/libc/sysv/calls/sys_epoll_pwait.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_epoll_pwait,0xfffffffffffff919,0x016,globl,hidden +.scall sys_epoll_pwait,0xfffffffffffff919,22,4095,globl,hidden diff --git a/libc/sysv/calls/sys_epoll_pwait2.S b/libc/sysv/calls/sys_epoll_pwait2.S index 2f05101cd..a75338270 100644 --- a/libc/sysv/calls/sys_epoll_pwait2.S +++ b/libc/sysv/calls/sys_epoll_pwait2.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_epoll_pwait2,0xfffffffffffff1b9,0x1b9,globl +.scall sys_epoll_pwait2,0xfffffffffffff1b9,441,4095,globl diff --git a/libc/sysv/calls/sys_epoll_wait.S b/libc/sysv/calls/sys_epoll_wait.S index 8045a8eaa..42d5eedc7 100644 --- a/libc/sysv/calls/sys_epoll_wait.S +++ b/libc/sysv/calls/sys_epoll_wait.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_epoll_wait,0xfffffffffffff8e8,0xfff,globl,hidden +.scall sys_epoll_wait,0xfffffffffffff8e8,4095,4095,globl,hidden diff --git a/libc/sysv/calls/sys_eventfd.S b/libc/sysv/calls/sys_eventfd.S index 9c8c238e5..e81a5298d 100644 --- a/libc/sysv/calls/sys_eventfd.S +++ b/libc/sysv/calls/sys_eventfd.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_eventfd,0xfffffffffffff11c,0xfff,globl +.scall sys_eventfd,0xfffffffffffff11c,4095,4095,globl diff --git a/libc/sysv/calls/sys_eventfd2.S b/libc/sysv/calls/sys_eventfd2.S index 01da687c7..2e0ddb47d 100644 --- a/libc/sysv/calls/sys_eventfd2.S +++ b/libc/sysv/calls/sys_eventfd2.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_eventfd2,0xfffffffffffff122,0x013,globl +.scall sys_eventfd2,0xfffffffffffff122,19,4095,globl diff --git a/libc/sysv/calls/sys_execveat.S b/libc/sysv/calls/sys_execveat.S index 3ed459a08..2ccf5f2e9 100644 --- a/libc/sysv/calls/sys_execveat.S +++ b/libc/sysv/calls/sys_execveat.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_execveat,0xfffffffffffff142,0x119,globl +.scall sys_execveat,0xfffffffffffff142,281,4095,globl diff --git a/libc/sysv/calls/sys_exit.S b/libc/sysv/calls/sys_exit.S index d4ac9a8ae..a625f0cc1 100644 --- a/libc/sysv/calls/sys_exit.S +++ b/libc/sysv/calls/sys_exit.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_exit,0x00100100120010e7,0x05e,globl,hidden +.scall sys_exit,0x00100100120010e7,94,1,globl,hidden diff --git a/libc/sysv/calls/sys_faccessat.S b/libc/sysv/calls/sys_faccessat.S index 3b0680b0b..d30e3fff4 100644 --- a/libc/sysv/calls/sys_faccessat.S +++ b/libc/sysv/calls/sys_faccessat.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_faccessat,0x1ce1391e921d210d,0x030,globl,hidden +.scall sys_faccessat,0x1ce1391e921d210d,48,466,globl,hidden diff --git a/libc/sysv/calls/sys_faccessat2.S b/libc/sysv/calls/sys_faccessat2.S index 2d33ac688..7c85a5491 100644 --- a/libc/sysv/calls/sys_faccessat2.S +++ b/libc/sysv/calls/sys_faccessat2.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_faccessat2,0xfffffffffffff1b7,0x1b7,globl,hidden +.scall sys_faccessat2,0xfffffffffffff1b7,439,4095,globl,hidden diff --git a/libc/sysv/calls/sys_fadvise.S b/libc/sysv/calls/sys_fadvise.S index 9d415c2bc..838227f2f 100644 --- a/libc/sysv/calls/sys_fadvise.S +++ b/libc/sysv/calls/sys_fadvise.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fadvise,0x1a0fff213ffff0dd,0x0df,globl,hidden +.scall sys_fadvise,0x1a0fff213ffff0dd,223,4095,globl,hidden diff --git a/libc/sysv/calls/sys_fallocate.S b/libc/sysv/calls/sys_fallocate.S index 39906260b..d6f8bcb38 100644 --- a/libc/sysv/calls/sys_fallocate.S +++ b/libc/sysv/calls/sys_fallocate.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fallocate,0xfffffffffffff91d,0x02f,globl +.scall sys_fallocate,0xfffffffffffff91d,47,4095,globl diff --git a/libc/sysv/calls/sys_fanotify_init.S b/libc/sysv/calls/sys_fanotify_init.S index 7f0e5f6f0..2feea1ca7 100644 --- a/libc/sysv/calls/sys_fanotify_init.S +++ b/libc/sysv/calls/sys_fanotify_init.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fanotify_init,0xfffffffffffff12c,0x106,globl +.scall sys_fanotify_init,0xfffffffffffff12c,262,4095,globl diff --git a/libc/sysv/calls/sys_fanotify_mark.S b/libc/sysv/calls/sys_fanotify_mark.S index 3ef12fa43..ff229ea76 100644 --- a/libc/sysv/calls/sys_fanotify_mark.S +++ b/libc/sysv/calls/sys_fanotify_mark.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fanotify_mark,0xfffffffffffff12d,0x107,globl +.scall sys_fanotify_mark,0xfffffffffffff12d,263,4095,globl diff --git a/libc/sysv/calls/sys_fchdir.S b/libc/sysv/calls/sys_fchdir.S index 7b9eab7e6..3bc247944 100644 --- a/libc/sysv/calls/sys_fchdir.S +++ b/libc/sysv/calls/sys_fchdir.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fchdir,0x00d00d00d200d051,0x032,globl,hidden +.scall sys_fchdir,0x00d00d00d200d051,50,13,globl,hidden diff --git a/libc/sysv/calls/sys_fchflags.S b/libc/sysv/calls/sys_fchflags.S index d548803a9..df0309405 100644 --- a/libc/sysv/calls/sys_fchflags.S +++ b/libc/sysv/calls/sys_fchflags.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fchflags,0x0230230232023fff,0xfff,globl +.scall sys_fchflags,0x0230230232023fff,4095,35,globl diff --git a/libc/sysv/calls/sys_fchmod.S b/libc/sysv/calls/sys_fchmod.S index 07151d4ba..e26df0e52 100644 --- a/libc/sysv/calls/sys_fchmod.S +++ b/libc/sysv/calls/sys_fchmod.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fchmod,0x07c07c07c207c05b,0x034,globl,hidden +.scall sys_fchmod,0x07c07c07c207c05b,52,124,globl,hidden diff --git a/libc/sysv/calls/sys_fchmodat.S b/libc/sysv/calls/sys_fchmodat.S index 26a19d2a8..34b5dfd53 100644 --- a/libc/sysv/calls/sys_fchmodat.S +++ b/libc/sysv/calls/sys_fchmodat.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fchmodat,0x1cf13a1ea21d310c,0x035,globl,hidden +.scall sys_fchmodat,0x1cf13a1ea21d310c,53,467,globl,hidden diff --git a/libc/sysv/calls/sys_fchown.S b/libc/sysv/calls/sys_fchown.S index 971541e0e..ea06837ac 100644 --- a/libc/sysv/calls/sys_fchown.S +++ b/libc/sysv/calls/sys_fchown.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fchown,0x07b07b07b207b05d,0x037,globl,hidden +.scall sys_fchown,0x07b07b07b207b05d,55,123,globl,hidden diff --git a/libc/sysv/calls/sys_fchownat.S b/libc/sysv/calls/sys_fchownat.S index 66093a175..f66db12dc 100644 --- a/libc/sysv/calls/sys_fchownat.S +++ b/libc/sysv/calls/sys_fchownat.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fchownat,0x1d013b1eb21d4104,0x036,globl,hidden +.scall sys_fchownat,0x1d013b1eb21d4104,54,468,globl,hidden diff --git a/libc/sysv/calls/sys_fdatasync.S b/libc/sysv/calls/sys_fdatasync.S index 2a9b3aeeb..79b80f3ba 100644 --- a/libc/sysv/calls/sys_fdatasync.S +++ b/libc/sysv/calls/sys_fdatasync.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fdatasync,0x8f185fa2628bb84b,0x053,globl,hidden +.scall sys_fdatasync,0x8f185fa2628bb84b,83,187,globl,hidden diff --git a/libc/sysv/calls/sys_fexecve.S b/libc/sysv/calls/sys_fexecve.S index b82aa7ff6..fc65ea7fb 100644 --- a/libc/sysv/calls/sys_fexecve.S +++ b/libc/sysv/calls/sys_fexecve.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fexecve,0xffffff1ecfffffff,0xfff,globl,hidden +.scall sys_fexecve,0xffffff1ecfffffff,4095,4095,globl,hidden diff --git a/libc/sysv/calls/sys_fgetxattr.S b/libc/sysv/calls/sys_fgetxattr.S index 070c276da..daafcd08b 100644 --- a/libc/sysv/calls/sys_fgetxattr.S +++ b/libc/sysv/calls/sys_fgetxattr.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fgetxattr,0x17cffffff20eb0c1,0x00a,globl +.scall sys_fgetxattr,0x17cffffff20eb0c1,10,235,globl diff --git a/libc/sysv/calls/sys_fhopen.S b/libc/sysv/calls/sys_fhopen.S index 89c48aa92..7d806311c 100644 --- a/libc/sysv/calls/sys_fhopen.S +++ b/libc/sysv/calls/sys_fhopen.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fhopen,0x18c10812a20f8fff,0xfff,globl +.scall sys_fhopen,0x18c10812a20f8fff,4095,248,globl diff --git a/libc/sysv/calls/sys_fhstat.S b/libc/sysv/calls/sys_fhstat.S index 21efd5ad0..c2f8244fe 100644 --- a/libc/sysv/calls/sys_fhstat.S +++ b/libc/sysv/calls/sys_fhstat.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fhstat,0x1c3126229fffffff,0xfff,globl +.scall sys_fhstat,0x1c3126229fffffff,4095,4095,globl diff --git a/libc/sysv/calls/sys_fhstatfs.S b/libc/sysv/calls/sys_fhstatfs.S index 43647e504..d54880b64 100644 --- a/libc/sysv/calls/sys_fhstatfs.S +++ b/libc/sysv/calls/sys_fhstatfs.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fhstatfs,0xfff04122efffffff,0xfff,globl +.scall sys_fhstatfs,0xfff04122efffffff,4095,4095,globl diff --git a/libc/sysv/calls/sys_finit_module.S b/libc/sysv/calls/sys_finit_module.S index 5fcbadeda..8d87d7162 100644 --- a/libc/sysv/calls/sys_finit_module.S +++ b/libc/sysv/calls/sys_finit_module.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_finit_module,0xfffffffffffff139,0x111,globl +.scall sys_finit_module,0xfffffffffffff139,273,4095,globl diff --git a/libc/sysv/calls/sys_flistxattr.S b/libc/sysv/calls/sys_flistxattr.S index 62c63bbc2..263398ea8 100644 --- a/libc/sysv/calls/sys_flistxattr.S +++ b/libc/sysv/calls/sys_flistxattr.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_flistxattr,0x17fffffff20f10c4,0x00d,globl +.scall sys_flistxattr,0x17fffffff20f10c4,13,241,globl diff --git a/libc/sysv/calls/sys_flock.S b/libc/sysv/calls/sys_flock.S index 5b4a24755..108261031 100644 --- a/libc/sysv/calls/sys_flock.S +++ b/libc/sysv/calls/sys_flock.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_flock,0x8838838832883849,0x020,globl,hidden +.scall sys_flock,0x8838838832883849,32,131,globl,hidden diff --git a/libc/sysv/calls/sys_fpathconf.S b/libc/sysv/calls/sys_fpathconf.S index 15d4607c6..ce0cabbbe 100644 --- a/libc/sysv/calls/sys_fpathconf.S +++ b/libc/sysv/calls/sys_fpathconf.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fpathconf,0x0c00c00c020c0fff,0xfff,globl +.scall sys_fpathconf,0x0c00c00c020c0fff,4095,192,globl diff --git a/libc/sysv/calls/sys_fremovexattr.S b/libc/sysv/calls/sys_fremovexattr.S index 4465078b2..f717d4231 100644 --- a/libc/sysv/calls/sys_fremovexattr.S +++ b/libc/sysv/calls/sys_fremovexattr.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fremovexattr,0x182ffffff20ef0c7,0x010,globl +.scall sys_fremovexattr,0x182ffffff20ef0c7,16,239,globl diff --git a/libc/sysv/calls/sys_fsconfig.S b/libc/sysv/calls/sys_fsconfig.S index 99ffbf40b..ddfdf7a20 100644 --- a/libc/sysv/calls/sys_fsconfig.S +++ b/libc/sysv/calls/sys_fsconfig.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fsconfig,0xfffffffffffff1af,0x1af,globl +.scall sys_fsconfig,0xfffffffffffff1af,431,4095,globl diff --git a/libc/sysv/calls/sys_fsetxattr.S b/libc/sysv/calls/sys_fsetxattr.S index 9f4b809a2..d399882f5 100644 --- a/libc/sysv/calls/sys_fsetxattr.S +++ b/libc/sysv/calls/sys_fsetxattr.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fsetxattr,0x179ffffff20ed0be,0x007,globl +.scall sys_fsetxattr,0x179ffffff20ed0be,7,237,globl diff --git a/libc/sysv/calls/sys_fsmount.S b/libc/sysv/calls/sys_fsmount.S index 9c200cc4f..43b58acb5 100644 --- a/libc/sysv/calls/sys_fsmount.S +++ b/libc/sysv/calls/sys_fsmount.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fsmount,0xfffffffffffff1b0,0x1b0,globl +.scall sys_fsmount,0xfffffffffffff1b0,432,4095,globl diff --git a/libc/sysv/calls/sys_fsopen.S b/libc/sysv/calls/sys_fsopen.S index bf707f4ba..cf36943ab 100644 --- a/libc/sysv/calls/sys_fsopen.S +++ b/libc/sysv/calls/sys_fsopen.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fsopen,0xfffffffffffff1ae,0x1ae,globl +.scall sys_fsopen,0xfffffffffffff1ae,430,4095,globl diff --git a/libc/sysv/calls/sys_fspick.S b/libc/sysv/calls/sys_fspick.S index a5ec375ff..5094512ca 100644 --- a/libc/sysv/calls/sys_fspick.S +++ b/libc/sysv/calls/sys_fspick.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fspick,0xfffffffffffff1b1,0x1b1,globl +.scall sys_fspick,0xfffffffffffff1b1,433,4095,globl diff --git a/libc/sysv/calls/sys_fstatfs.S b/libc/sysv/calls/sys_fstatfs.S index 7fa9eec2c..54fb26954 100644 --- a/libc/sysv/calls/sys_fstatfs.S +++ b/libc/sysv/calls/sys_fstatfs.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fstatfs,0x89e840a2c295a88a,0x02c,globl,hidden +.scall sys_fstatfs,0x89e840a2c295a88a,44,346,globl,hidden diff --git a/libc/sysv/calls/sys_fsync.S b/libc/sysv/calls/sys_fsync.S index 8e04a0d1c..8732bc3c2 100644 --- a/libc/sysv/calls/sys_fsync.S +++ b/libc/sysv/calls/sys_fsync.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_fsync,0x85f85f85f285f84a,0x052,globl,hidden +.scall sys_fsync,0x85f85f85f285f84a,82,95,globl,hidden diff --git a/libc/sysv/calls/sys_ftruncate.S b/libc/sysv/calls/sys_ftruncate.S index 84b9675b5..cfc07882a 100644 --- a/libc/sysv/calls/sys_ftruncate.S +++ b/libc/sysv/calls/sys_ftruncate.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_ftruncate,0x8c98c99e028c984d,0x02e,globl,hidden +.scall sys_ftruncate,0x8c98c99e028c984d,46,201,globl,hidden diff --git a/libc/sysv/calls/sys_futex.S b/libc/sysv/calls/sys_futex.S index 4c38fc929..461358028 100644 --- a/libc/sysv/calls/sys_futex.S +++ b/libc/sysv/calls/sys_futex.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_futex,0x0a60531c6ffff0ca,0x062,globl,hidden +.scall sys_futex,0x0a60531c6ffff0ca,98,4095,globl,hidden diff --git a/libc/sysv/calls/sys_futex_cp.S b/libc/sysv/calls/sys_futex_cp.S index e6e4564c8..022649c12 100644 --- a/libc/sysv/calls/sys_futex_cp.S +++ b/libc/sysv/calls/sys_futex_cp.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_futex_cp,0x8a68539c6ffff8ca,0x062,globl,hidden +.scall sys_futex_cp,0x8a68539c6ffff8ca,98,4095,globl,hidden diff --git a/libc/sysv/calls/sys_futex_waitv.S b/libc/sysv/calls/sys_futex_waitv.S index fc6fc1f4f..984dfba94 100644 --- a/libc/sysv/calls/sys_futex_waitv.S +++ b/libc/sysv/calls/sys_futex_waitv.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_futex_waitv,0xfffffffffffff1c1,0xfff,globl +.scall sys_futex_waitv,0xfffffffffffff1c1,4095,4095,globl diff --git a/libc/sysv/calls/sys_futimens.S b/libc/sysv/calls/sys_futimens.S index 570c8de2c..cc90d8dbb 100644 --- a/libc/sysv/calls/sys_futimens.S +++ b/libc/sysv/calls/sys_futimens.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_futimens,0x1d8055222fffffff,0xfff,globl,hidden +.scall sys_futimens,0x1d8055222fffffff,4095,4095,globl,hidden diff --git a/libc/sysv/calls/sys_futimes.S b/libc/sysv/calls/sys_futimes.S index c8fe8930d..68677783d 100644 --- a/libc/sysv/calls/sys_futimes.S +++ b/libc/sysv/calls/sys_futimes.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_futimes,0x1a704d0ce208bfff,0xfff,globl,hidden +.scall sys_futimes,0x1a704d0ce208bfff,4095,139,globl,hidden diff --git a/libc/sysv/calls/sys_get_robust_list.S b/libc/sysv/calls/sys_get_robust_list.S index 234ba084b..efae7964d 100644 --- a/libc/sysv/calls/sys_get_robust_list.S +++ b/libc/sysv/calls/sys_get_robust_list.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_get_robust_list,0x0a8ffffffffff112,0x064,globl +.scall sys_get_robust_list,0x0a8ffffffffff112,100,4095,globl diff --git a/libc/sysv/calls/sys_getaudit_addr.S b/libc/sysv/calls/sys_getaudit_addr.S index 0366e0d68..27a4658da 100644 --- a/libc/sysv/calls/sys_getaudit_addr.S +++ b/libc/sysv/calls/sys_getaudit_addr.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getaudit_addr,0xffffff1c32165fff,0xfff,globl +.scall sys_getaudit_addr,0xffffff1c32165fff,4095,357,globl diff --git a/libc/sysv/calls/sys_getauid.S b/libc/sysv/calls/sys_getauid.S index 6300aee95..14d36244b 100644 --- a/libc/sysv/calls/sys_getauid.S +++ b/libc/sysv/calls/sys_getauid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getauid,0xffffff1bf2161fff,0xfff,globl +.scall sys_getauid,0xffffff1bf2161fff,4095,353,globl diff --git a/libc/sysv/calls/sys_getcontext.S b/libc/sysv/calls/sys_getcontext.S index fa7081054..eec840884 100644 --- a/libc/sysv/calls/sys_getcontext.S +++ b/libc/sysv/calls/sys_getcontext.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getcontext,0x133fff1a5fffffff,0xfff,globl,hidden +.scall sys_getcontext,0x133fff1a5fffffff,4095,4095,globl,hidden diff --git a/libc/sysv/calls/sys_getcpu.S b/libc/sysv/calls/sys_getcpu.S index 8f3eb0b2e..aaa8a4f63 100644 --- a/libc/sysv/calls/sys_getcpu.S +++ b/libc/sysv/calls/sys_getcpu.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getcpu,0xfffffffffffff135,0x0a8,globl +.scall sys_getcpu,0xfffffffffffff135,168,4095,globl diff --git a/libc/sysv/calls/sys_getcwd.S b/libc/sysv/calls/sys_getcwd.S index 71f35b0a9..06f9cb37a 100644 --- a/libc/sysv/calls/sys_getcwd.S +++ b/libc/sysv/calls/sys_getcwd.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getcwd,0x128130146ffff04f,0x011,globl,hidden +.scall sys_getcwd,0x128130146ffff04f,17,4095,globl,hidden diff --git a/libc/sysv/calls/sys_getdents.S b/libc/sysv/calls/sys_getdents.S index a269b60be..9c5192e2a 100644 --- a/libc/sysv/calls/sys_getdents.S +++ b/libc/sysv/calls/sys_getdents.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getdents,0x18606311020c40d9,0x03d,globl,hidden +.scall sys_getdents,0x18606311020c40d9,61,196,globl,hidden diff --git a/libc/sysv/calls/sys_getdirentries.S b/libc/sysv/calls/sys_getdirentries.S index 4150ab7f9..c8f044119 100644 --- a/libc/sysv/calls/sys_getdirentries.S +++ b/libc/sysv/calls/sys_getdirentries.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getdirentries,0xffffff22a20c4fff,0xfff,globl +.scall sys_getdirentries,0xffffff22a20c4fff,4095,196,globl diff --git a/libc/sysv/calls/sys_getdtablesize.S b/libc/sysv/calls/sys_getdtablesize.S index cd5eae0a4..4909a0d2c 100644 --- a/libc/sysv/calls/sys_getdtablesize.S +++ b/libc/sysv/calls/sys_getdtablesize.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getdtablesize,0xffffff0592059fff,0xfff,globl +.scall sys_getdtablesize,0xffffff0592059fff,4095,89,globl diff --git a/libc/sysv/calls/sys_getegid.S b/libc/sysv/calls/sys_getegid.S index d9039be87..1cf9a4ce1 100644 --- a/libc/sysv/calls/sys_getegid.S +++ b/libc/sysv/calls/sys_getegid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getegid,0x02b02b02b202b06c,0x0b1,globl,hidden +.scall sys_getegid,0x02b02b02b202b06c,177,43,globl,hidden diff --git a/libc/sysv/calls/sys_geteuid.S b/libc/sysv/calls/sys_geteuid.S index dc72a27bc..49ed602fe 100644 --- a/libc/sysv/calls/sys_geteuid.S +++ b/libc/sysv/calls/sys_geteuid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_geteuid,0x019019019201906b,0x0af,globl,hidden +.scall sys_geteuid,0x019019019201906b,175,25,globl,hidden diff --git a/libc/sysv/calls/sys_getfh.S b/libc/sysv/calls/sys_getfh.S index 2476f73c1..9dff35fb1 100644 --- a/libc/sysv/calls/sys_getfh.S +++ b/libc/sysv/calls/sys_getfh.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getfh,0x18b0a10a120a1fff,0xfff,globl +.scall sys_getfh,0x18b0a10a120a1fff,4095,161,globl diff --git a/libc/sysv/calls/sys_getfsstat.S b/libc/sysv/calls/sys_getfsstat.S index 79492316b..63004edf5 100644 --- a/libc/sysv/calls/sys_getfsstat.S +++ b/libc/sysv/calls/sys_getfsstat.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getfsstat,0xfff03e22d215bfff,0xfff,globl +.scall sys_getfsstat,0xfff03e22d215bfff,4095,347,globl diff --git a/libc/sysv/calls/sys_getgid.S b/libc/sysv/calls/sys_getgid.S index cea80453b..a4b5d6d23 100644 --- a/libc/sysv/calls/sys_getgid.S +++ b/libc/sysv/calls/sys_getgid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getgid,0x02f02f02f202f068,0x0b0,globl,hidden +.scall sys_getgid,0x02f02f02f202f068,176,47,globl,hidden diff --git a/libc/sysv/calls/sys_getgroups.S b/libc/sysv/calls/sys_getgroups.S index 6793a0b64..30213ac03 100644 --- a/libc/sysv/calls/sys_getgroups.S +++ b/libc/sysv/calls/sys_getgroups.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getgroups,0x04f04f04f204f073,0x09e,globl,hidden +.scall sys_getgroups,0x04f04f04f204f073,158,79,globl,hidden diff --git a/libc/sysv/calls/sys_getitimer.S b/libc/sysv/calls/sys_getitimer.S index dd91a402d..37515d42a 100644 --- a/libc/sysv/calls/sys_getitimer.S +++ b/libc/sysv/calls/sys_getitimer.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getitimer,0x1aa0460562056024,0x066,globl,hidden +.scall sys_getitimer,0x1aa0460562056024,102,86,globl,hidden diff --git a/libc/sysv/calls/sys_getlogin.S b/libc/sysv/calls/sys_getlogin.S index b7283fba5..d1ad6d097 100644 --- a/libc/sysv/calls/sys_getlogin.S +++ b/libc/sysv/calls/sys_getlogin.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getlogin,0x03108d0312031fff,0xfff,globl,hidden +.scall sys_getlogin,0x03108d0312031fff,4095,49,globl,hidden diff --git a/libc/sysv/calls/sys_getpgid.S b/libc/sysv/calls/sys_getpgid.S index 9b213718b..d1faff9e4 100644 --- a/libc/sysv/calls/sys_getpgid.S +++ b/libc/sysv/calls/sys_getpgid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getpgid,0x0cf0cf0cf2097079,0x09b,globl,hidden +.scall sys_getpgid,0x0cf0cf0cf2097079,155,151,globl,hidden diff --git a/libc/sysv/calls/sys_getpid.S b/libc/sysv/calls/sys_getpid.S index d9d4a10c5..9bc2b9657 100644 --- a/libc/sysv/calls/sys_getpid.S +++ b/libc/sysv/calls/sys_getpid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getpid,0x0140140142014027,0x0ac,globl,hidden +.scall sys_getpid,0x0140140142014027,172,20,globl,hidden diff --git a/libc/sysv/calls/sys_getppid.S b/libc/sysv/calls/sys_getppid.S index 67a86cb16..f8e20b7d1 100644 --- a/libc/sysv/calls/sys_getppid.S +++ b/libc/sysv/calls/sys_getppid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getppid,0xfff027027202706e,0x0ad,globl,hidden +.scall sys_getppid,0xfff027027202706e,173,39,globl,hidden diff --git a/libc/sysv/calls/sys_getpriority.S b/libc/sysv/calls/sys_getpriority.S index af26ab36a..ac3bf1b38 100644 --- a/libc/sysv/calls/sys_getpriority.S +++ b/libc/sysv/calls/sys_getpriority.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getpriority,0x064064064206408c,0x08d,globl,hidden +.scall sys_getpriority,0x064064064206408c,141,100,globl,hidden diff --git a/libc/sysv/calls/sys_getrandom.S b/libc/sysv/calls/sys_getrandom.S index 26bfa864d..5a2848bf0 100644 --- a/libc/sysv/calls/sys_getrandom.S +++ b/libc/sysv/calls/sys_getrandom.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getrandom,0xfff007a3321f493e,0x116,globl,hidden +.scall sys_getrandom,0xfff007a3321f493e,278,500,globl,hidden diff --git a/libc/sysv/calls/sys_getresgid.S b/libc/sysv/calls/sys_getresgid.S index 1805687fd..fda453a68 100644 --- a/libc/sysv/calls/sys_getresgid.S +++ b/libc/sysv/calls/sys_getresgid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getresgid,0xfff11b169ffff078,0x096,globl,hidden +.scall sys_getresgid,0xfff11b169ffff078,150,4095,globl,hidden diff --git a/libc/sysv/calls/sys_getresuid.S b/libc/sysv/calls/sys_getresuid.S index f664317e6..10ae1d8b6 100644 --- a/libc/sysv/calls/sys_getresuid.S +++ b/libc/sysv/calls/sys_getresuid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getresuid,0xfff119168ffff076,0x094,globl,hidden +.scall sys_getresuid,0xfff119168ffff076,148,4095,globl,hidden diff --git a/libc/sysv/calls/sys_getrlimit.S b/libc/sysv/calls/sys_getrlimit.S index 17d94910f..9a03e8333 100644 --- a/libc/sysv/calls/sys_getrlimit.S +++ b/libc/sysv/calls/sys_getrlimit.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getrlimit,0x0c20c20c220c2061,0x0a3,globl,hidden +.scall sys_getrlimit,0x0c20c20c220c2061,163,194,globl,hidden diff --git a/libc/sysv/calls/sys_getsid.S b/libc/sysv/calls/sys_getsid.S index 75e7ff5f4..7e61cb090 100644 --- a/libc/sysv/calls/sys_getsid.S +++ b/libc/sysv/calls/sys_getsid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getsid,0x11e0ff136213607c,0x09c,globl,hidden +.scall sys_getsid,0x11e0ff136213607c,156,310,globl,hidden diff --git a/libc/sysv/calls/sys_getsockopt.S b/libc/sysv/calls/sys_getsockopt.S index 1ad681bb4..8131745d8 100644 --- a/libc/sysv/calls/sys_getsockopt.S +++ b/libc/sysv/calls/sys_getsockopt.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getsockopt,0x0760760762076037,0x0d1,globl,hidden +.scall sys_getsockopt,0x0760760762076037,209,118,globl,hidden diff --git a/libc/sysv/calls/sys_gettimeofday.S b/libc/sysv/calls/sys_gettimeofday.S index e8f1daf62..77ee3fbd8 100644 --- a/libc/sysv/calls/sys_gettimeofday.S +++ b/libc/sysv/calls/sys_gettimeofday.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_gettimeofday,0x1a20430742074060,0x0a9,globl,hidden +.scall sys_gettimeofday,0x1a20430742074060,169,116,globl,hidden diff --git a/libc/sysv/calls/sys_getuid.S b/libc/sysv/calls/sys_getuid.S index 75c769ea6..33a4873de 100644 --- a/libc/sysv/calls/sys_getuid.S +++ b/libc/sysv/calls/sys_getuid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getuid,0x0180180182018066,0x0ae,globl,hidden +.scall sys_getuid,0x0180180182018066,174,24,globl,hidden diff --git a/libc/sysv/calls/sys_getxattr.S b/libc/sysv/calls/sys_getxattr.S index b6135fe9e..85274a8e0 100644 --- a/libc/sysv/calls/sys_getxattr.S +++ b/libc/sysv/calls/sys_getxattr.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_getxattr,0x17affffff20ea0bf,0x008,globl +.scall sys_getxattr,0x17affffff20ea0bf,8,234,globl diff --git a/libc/sysv/calls/sys_init_module.S b/libc/sysv/calls/sys_init_module.S index d7370fcc4..efc786e07 100644 --- a/libc/sysv/calls/sys_init_module.S +++ b/libc/sysv/calls/sys_init_module.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_init_module,0xfffffffffffff0af,0x069,globl +.scall sys_init_module,0xfffffffffffff0af,105,4095,globl diff --git a/libc/sysv/calls/sys_inotify_add_watch.S b/libc/sysv/calls/sys_inotify_add_watch.S index 6ee0c8799..1654f648d 100644 --- a/libc/sysv/calls/sys_inotify_add_watch.S +++ b/libc/sysv/calls/sys_inotify_add_watch.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_inotify_add_watch,0xfffffffffffff0fe,0xfff,globl +.scall sys_inotify_add_watch,0xfffffffffffff0fe,4095,4095,globl diff --git a/libc/sysv/calls/sys_inotify_init.S b/libc/sysv/calls/sys_inotify_init.S index 8b5b58f2f..4ef54e0d5 100644 --- a/libc/sysv/calls/sys_inotify_init.S +++ b/libc/sysv/calls/sys_inotify_init.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_inotify_init,0xfffffffffffff0fd,0xfff,globl +.scall sys_inotify_init,0xfffffffffffff0fd,4095,4095,globl diff --git a/libc/sysv/calls/sys_inotify_init1.S b/libc/sysv/calls/sys_inotify_init1.S index 039e4793b..42c229bf8 100644 --- a/libc/sysv/calls/sys_inotify_init1.S +++ b/libc/sysv/calls/sys_inotify_init1.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_inotify_init1,0xfffffffffffff126,0x01a,globl +.scall sys_inotify_init1,0xfffffffffffff126,26,4095,globl diff --git a/libc/sysv/calls/sys_inotify_rm_watch.S b/libc/sysv/calls/sys_inotify_rm_watch.S index 5d0f16735..885461b76 100644 --- a/libc/sysv/calls/sys_inotify_rm_watch.S +++ b/libc/sysv/calls/sys_inotify_rm_watch.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_inotify_rm_watch,0xfffffffffffff0ff,0xfff,globl +.scall sys_inotify_rm_watch,0xfffffffffffff0ff,4095,4095,globl diff --git a/libc/sysv/calls/sys_io_cancel.S b/libc/sysv/calls/sys_io_cancel.S index 52b4bcccf..b3cc628e1 100644 --- a/libc/sysv/calls/sys_io_cancel.S +++ b/libc/sysv/calls/sys_io_cancel.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_io_cancel,0xfffffffffffff0d2,0x003,globl +.scall sys_io_cancel,0xfffffffffffff0d2,3,4095,globl diff --git a/libc/sysv/calls/sys_io_destroy.S b/libc/sysv/calls/sys_io_destroy.S index ef445cb51..fb11d3bd2 100644 --- a/libc/sysv/calls/sys_io_destroy.S +++ b/libc/sysv/calls/sys_io_destroy.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_io_destroy,0xfffffffffffff0cf,0x001,globl +.scall sys_io_destroy,0xfffffffffffff0cf,1,4095,globl diff --git a/libc/sysv/calls/sys_io_getevents.S b/libc/sysv/calls/sys_io_getevents.S index 883c41050..8c30155a0 100644 --- a/libc/sysv/calls/sys_io_getevents.S +++ b/libc/sysv/calls/sys_io_getevents.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_io_getevents,0xfffffffffffff0d0,0x004,globl +.scall sys_io_getevents,0xfffffffffffff0d0,4,4095,globl diff --git a/libc/sysv/calls/sys_io_pgetevents.S b/libc/sysv/calls/sys_io_pgetevents.S index 2db07941e..694ca3d8f 100644 --- a/libc/sysv/calls/sys_io_pgetevents.S +++ b/libc/sysv/calls/sys_io_pgetevents.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_io_pgetevents,0xfffffffffffff14d,0x124,globl +.scall sys_io_pgetevents,0xfffffffffffff14d,292,4095,globl diff --git a/libc/sysv/calls/sys_io_setup.S b/libc/sysv/calls/sys_io_setup.S index f31d40383..4a7a27caf 100644 --- a/libc/sysv/calls/sys_io_setup.S +++ b/libc/sysv/calls/sys_io_setup.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_io_setup,0xfffffffffffff0ce,0x000,globl +.scall sys_io_setup,0xfffffffffffff0ce,0,4095,globl diff --git a/libc/sysv/calls/sys_io_submit.S b/libc/sysv/calls/sys_io_submit.S index 0986487c1..39b2aeaa1 100644 --- a/libc/sysv/calls/sys_io_submit.S +++ b/libc/sysv/calls/sys_io_submit.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_io_submit,0xfffffffffffff0d1,0x002,globl +.scall sys_io_submit,0xfffffffffffff0d1,2,4095,globl diff --git a/libc/sysv/calls/sys_io_uring_enter.S b/libc/sysv/calls/sys_io_uring_enter.S index fc2706611..e5bc4fd40 100644 --- a/libc/sysv/calls/sys_io_uring_enter.S +++ b/libc/sysv/calls/sys_io_uring_enter.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_io_uring_enter,0xfffffffffffff1aa,0x1aa,globl +.scall sys_io_uring_enter,0xfffffffffffff1aa,426,4095,globl diff --git a/libc/sysv/calls/sys_io_uring_register.S b/libc/sysv/calls/sys_io_uring_register.S index bfcc78585..5958e6166 100644 --- a/libc/sysv/calls/sys_io_uring_register.S +++ b/libc/sysv/calls/sys_io_uring_register.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_io_uring_register,0xfffffffffffff1ab,0x1ab,globl +.scall sys_io_uring_register,0xfffffffffffff1ab,427,4095,globl diff --git a/libc/sysv/calls/sys_io_uring_setup.S b/libc/sysv/calls/sys_io_uring_setup.S index 04898ecb6..6afadf362 100644 --- a/libc/sysv/calls/sys_io_uring_setup.S +++ b/libc/sysv/calls/sys_io_uring_setup.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_io_uring_setup,0xfffffffffffff1a9,0x1a9,globl +.scall sys_io_uring_setup,0xfffffffffffff1a9,425,4095,globl diff --git a/libc/sysv/calls/sys_ioctl.S b/libc/sysv/calls/sys_ioctl.S index 34813dc8a..0f20f8fce 100644 --- a/libc/sysv/calls/sys_ioctl.S +++ b/libc/sysv/calls/sys_ioctl.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_ioctl,0x0360360362036010,0x01d,globl,hidden +.scall sys_ioctl,0x0360360362036010,29,54,globl,hidden diff --git a/libc/sysv/calls/sys_ioctl_cp.S b/libc/sysv/calls/sys_ioctl_cp.S index 082611b6e..755d6ef9e 100644 --- a/libc/sysv/calls/sys_ioctl_cp.S +++ b/libc/sysv/calls/sys_ioctl_cp.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_ioctl_cp,0x8368368362836810,0x01d,globl,hidden +.scall sys_ioctl_cp,0x8368368362836810,29,54,globl,hidden diff --git a/libc/sysv/calls/sys_ioperm.S b/libc/sysv/calls/sys_ioperm.S index 036b533a6..6958a715a 100644 --- a/libc/sysv/calls/sys_ioperm.S +++ b/libc/sysv/calls/sys_ioperm.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_ioperm,0xfffffffffffff0ad,0xfff,globl +.scall sys_ioperm,0xfffffffffffff0ad,4095,4095,globl diff --git a/libc/sysv/calls/sys_iopl.S b/libc/sysv/calls/sys_iopl.S index 022072db9..34756c565 100644 --- a/libc/sysv/calls/sys_iopl.S +++ b/libc/sysv/calls/sys_iopl.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_iopl,0xfffffffffffff0ac,0xfff,globl +.scall sys_iopl,0xfffffffffffff0ac,4095,4095,globl diff --git a/libc/sysv/calls/sys_issetugid.S b/libc/sysv/calls/sys_issetugid.S index 8f77c4479..88f6ac100 100644 --- a/libc/sysv/calls/sys_issetugid.S +++ b/libc/sysv/calls/sys_issetugid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_issetugid,0xfff0fd0fd2147fff,0xfff,globl,hidden +.scall sys_issetugid,0xfff0fd0fd2147fff,4095,327,globl,hidden diff --git a/libc/sysv/calls/sys_kcmp.S b/libc/sysv/calls/sys_kcmp.S index 1ef94d085..62733edc4 100644 --- a/libc/sysv/calls/sys_kcmp.S +++ b/libc/sysv/calls/sys_kcmp.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_kcmp,0xfffffffffffff138,0x110,globl +.scall sys_kcmp,0xfffffffffffff138,272,4095,globl diff --git a/libc/sysv/calls/sys_kevent.S b/libc/sysv/calls/sys_kevent.S index 11cd50387..b53897e37 100644 --- a/libc/sysv/calls/sys_kevent.S +++ b/libc/sysv/calls/sys_kevent.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_kevent,0x1b30482302171fff,0xfff,globl +.scall sys_kevent,0x1b30482302171fff,4095,369,globl diff --git a/libc/sysv/calls/sys_kexec_file_load.S b/libc/sysv/calls/sys_kexec_file_load.S index 2e943b88a..4e61bd9c1 100644 --- a/libc/sysv/calls/sys_kexec_file_load.S +++ b/libc/sysv/calls/sys_kexec_file_load.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_kexec_file_load,0xfffffffffffff140,0xfff,globl +.scall sys_kexec_file_load,0xfffffffffffff140,4095,4095,globl diff --git a/libc/sysv/calls/sys_kexec_load.S b/libc/sysv/calls/sys_kexec_load.S index e7b91449e..0e156483c 100644 --- a/libc/sysv/calls/sys_kexec_load.S +++ b/libc/sysv/calls/sys_kexec_load.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_kexec_load,0xfffffffffffff0f6,0x068,globl +.scall sys_kexec_load,0xfffffffffffff0f6,104,4095,globl diff --git a/libc/sysv/calls/sys_keyctl.S b/libc/sysv/calls/sys_keyctl.S index 734a954b6..1ba35d9e0 100644 --- a/libc/sysv/calls/sys_keyctl.S +++ b/libc/sysv/calls/sys_keyctl.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_keyctl,0xfffffffffffff0fa,0x0db,globl +.scall sys_keyctl,0xfffffffffffff0fa,219,4095,globl diff --git a/libc/sysv/calls/sys_kill.S b/libc/sysv/calls/sys_kill.S index bc56ac038..3d4ce041d 100644 --- a/libc/sysv/calls/sys_kill.S +++ b/libc/sysv/calls/sys_kill.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_kill,0x02507a025202503e,0x081,globl,hidden +.scall sys_kill,0x02507a025202503e,129,37,globl,hidden diff --git a/libc/sysv/calls/sys_killpg.S b/libc/sysv/calls/sys_killpg.S index f00daaf9b..48997695f 100644 --- a/libc/sysv/calls/sys_killpg.S +++ b/libc/sysv/calls/sys_killpg.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_killpg,0x092fff092fffffff,0xfff,globl,hidden +.scall sys_killpg,0x092fff092fffffff,4095,4095,globl,hidden diff --git a/libc/sysv/calls/sys_kqueue.S b/libc/sysv/calls/sys_kqueue.S index ab0e3a89d..557078bbf 100644 --- a/libc/sysv/calls/sys_kqueue.S +++ b/libc/sysv/calls/sys_kqueue.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_kqueue,0x15810d16a216afff,0xfff,globl +.scall sys_kqueue,0x15810d16a216afff,4095,362,globl diff --git a/libc/sysv/calls/sys_ktimer_create.S b/libc/sysv/calls/sys_ktimer_create.S index ef5342a9c..1b0f8146a 100644 --- a/libc/sysv/calls/sys_ktimer_create.S +++ b/libc/sysv/calls/sys_ktimer_create.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_ktimer_create,0xffffff0ebfffffff,0xfff,globl +.scall sys_ktimer_create,0xffffff0ebfffffff,4095,4095,globl diff --git a/libc/sysv/calls/sys_ktimer_delete.S b/libc/sysv/calls/sys_ktimer_delete.S index 48071a3ef..24234cee8 100644 --- a/libc/sysv/calls/sys_ktimer_delete.S +++ b/libc/sysv/calls/sys_ktimer_delete.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_ktimer_delete,0xffffff0ecfffffff,0xfff,globl +.scall sys_ktimer_delete,0xffffff0ecfffffff,4095,4095,globl diff --git a/libc/sysv/calls/sys_ktimer_getoverrun.S b/libc/sysv/calls/sys_ktimer_getoverrun.S index bdbf4faf6..3b53c4544 100644 --- a/libc/sysv/calls/sys_ktimer_getoverrun.S +++ b/libc/sysv/calls/sys_ktimer_getoverrun.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_ktimer_getoverrun,0xffffff0effffffff,0xfff,globl +.scall sys_ktimer_getoverrun,0xffffff0effffffff,4095,4095,globl diff --git a/libc/sysv/calls/sys_ktimer_gettime.S b/libc/sysv/calls/sys_ktimer_gettime.S index 0dae76064..c4f90c5c8 100644 --- a/libc/sysv/calls/sys_ktimer_gettime.S +++ b/libc/sysv/calls/sys_ktimer_gettime.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_ktimer_gettime,0xffffff0eefffffff,0xfff,globl +.scall sys_ktimer_gettime,0xffffff0eefffffff,4095,4095,globl diff --git a/libc/sysv/calls/sys_ktimer_settime.S b/libc/sysv/calls/sys_ktimer_settime.S index d723a303c..bf86eabb3 100644 --- a/libc/sysv/calls/sys_ktimer_settime.S +++ b/libc/sysv/calls/sys_ktimer_settime.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_ktimer_settime,0xffffff0edfffffff,0xfff,globl +.scall sys_ktimer_settime,0xffffff0edfffffff,4095,4095,globl diff --git a/libc/sysv/calls/sys_ktrace.S b/libc/sysv/calls/sys_ktrace.S index f70cf2ffe..3503694ec 100644 --- a/libc/sysv/calls/sys_ktrace.S +++ b/libc/sysv/calls/sys_ktrace.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_ktrace,0x02d02d02dfffffff,0xfff,globl +.scall sys_ktrace,0x02d02d02dfffffff,4095,4095,globl diff --git a/libc/sysv/calls/sys_landlock_add_rule.S b/libc/sysv/calls/sys_landlock_add_rule.S index ec6cf2ef9..6a5cc6202 100644 --- a/libc/sysv/calls/sys_landlock_add_rule.S +++ b/libc/sysv/calls/sys_landlock_add_rule.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_landlock_add_rule,0xfffffffffffff1bd,0x1bd,globl,hidden +.scall sys_landlock_add_rule,0xfffffffffffff1bd,445,4095,globl,hidden diff --git a/libc/sysv/calls/sys_landlock_create_ruleset.S b/libc/sysv/calls/sys_landlock_create_ruleset.S index e9fa95410..d29c031be 100644 --- a/libc/sysv/calls/sys_landlock_create_ruleset.S +++ b/libc/sysv/calls/sys_landlock_create_ruleset.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_landlock_create_ruleset,0xfffffffffffff1bc,0x1bc,globl,hidden +.scall sys_landlock_create_ruleset,0xfffffffffffff1bc,444,4095,globl,hidden diff --git a/libc/sysv/calls/sys_landlock_restrict_self.S b/libc/sysv/calls/sys_landlock_restrict_self.S index cca66ea60..149a2688c 100644 --- a/libc/sysv/calls/sys_landlock_restrict_self.S +++ b/libc/sysv/calls/sys_landlock_restrict_self.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_landlock_restrict_self,0xfffffffffffff1be,0x1be,globl,hidden +.scall sys_landlock_restrict_self,0xfffffffffffff1be,446,4095,globl,hidden diff --git a/libc/sysv/calls/sys_lgetxattr.S b/libc/sysv/calls/sys_lgetxattr.S index a134cebbe..e98f8f733 100644 --- a/libc/sysv/calls/sys_lgetxattr.S +++ b/libc/sysv/calls/sys_lgetxattr.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_lgetxattr,0x17bffffffffff0c0,0x009,globl +.scall sys_lgetxattr,0x17bffffffffff0c0,9,4095,globl diff --git a/libc/sysv/calls/sys_linkat.S b/libc/sysv/calls/sys_linkat.S index c1d81bf45..5f058521f 100644 --- a/libc/sysv/calls/sys_linkat.S +++ b/libc/sysv/calls/sys_linkat.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_linkat,0x1c913d1ef21d7109,0x025,globl,hidden +.scall sys_linkat,0x1c913d1ef21d7109,37,471,globl,hidden diff --git a/libc/sysv/calls/sys_lio_listio.S b/libc/sysv/calls/sys_lio_listio.S index cfff209e0..831d99dea 100644 --- a/libc/sysv/calls/sys_lio_listio.S +++ b/libc/sysv/calls/sys_lio_listio.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_lio_listio,0x196fff1402140fff,0xfff,globl +.scall sys_lio_listio,0x196fff1402140fff,4095,320,globl diff --git a/libc/sysv/calls/sys_listen.S b/libc/sysv/calls/sys_listen.S index 6508c8a98..633f4f4af 100644 --- a/libc/sysv/calls/sys_listen.S +++ b/libc/sysv/calls/sys_listen.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_listen,0x06a06a06a206a032,0x0c9,globl,hidden +.scall sys_listen,0x06a06a06a206a032,201,106,globl,hidden diff --git a/libc/sysv/calls/sys_listxattr.S b/libc/sysv/calls/sys_listxattr.S index 5c2f28570..a66b4b6bf 100644 --- a/libc/sysv/calls/sys_listxattr.S +++ b/libc/sysv/calls/sys_listxattr.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_listxattr,0x17dffffff20f00c2,0x00b,globl +.scall sys_listxattr,0x17dffffff20f00c2,11,240,globl diff --git a/libc/sysv/calls/sys_llistxattr.S b/libc/sysv/calls/sys_llistxattr.S index be63233d0..527aa4f97 100644 --- a/libc/sysv/calls/sys_llistxattr.S +++ b/libc/sysv/calls/sys_llistxattr.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_llistxattr,0x17effffffffff0c3,0x00c,globl +.scall sys_llistxattr,0x17effffffffff0c3,12,4095,globl diff --git a/libc/sysv/calls/sys_lookup_dcookie.S b/libc/sysv/calls/sys_lookup_dcookie.S index 74e1976fe..baa8cd5a1 100644 --- a/libc/sysv/calls/sys_lookup_dcookie.S +++ b/libc/sysv/calls/sys_lookup_dcookie.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_lookup_dcookie,0xfffffffffffff0d4,0x012,globl +.scall sys_lookup_dcookie,0xfffffffffffff0d4,18,4095,globl diff --git a/libc/sysv/calls/sys_lremovexattr.S b/libc/sysv/calls/sys_lremovexattr.S index f064d453c..c6b65fff8 100644 --- a/libc/sysv/calls/sys_lremovexattr.S +++ b/libc/sysv/calls/sys_lremovexattr.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_lremovexattr,0x181ffffffffff0c6,0x00f,globl +.scall sys_lremovexattr,0x181ffffffffff0c6,15,4095,globl diff --git a/libc/sysv/calls/sys_lseek.S b/libc/sysv/calls/sys_lseek.S index a63bcbe71..801f686de 100644 --- a/libc/sysv/calls/sys_lseek.S +++ b/libc/sysv/calls/sys_lseek.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_lseek,0x0c70c71de20c7008,0x03e,globl,hidden +.scall sys_lseek,0x0c70c71de20c7008,62,199,globl,hidden diff --git a/libc/sysv/calls/sys_lsetxattr.S b/libc/sysv/calls/sys_lsetxattr.S index ec67cfc44..b0fd194a5 100644 --- a/libc/sysv/calls/sys_lsetxattr.S +++ b/libc/sysv/calls/sys_lsetxattr.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_lsetxattr,0x178ffffffffff0bd,0x006,globl +.scall sys_lsetxattr,0x178ffffffffff0bd,6,4095,globl diff --git a/libc/sysv/calls/sys_lutimes.S b/libc/sysv/calls/sys_lutimes.S index fe75e6c0c..a75c7f90c 100644 --- a/libc/sysv/calls/sys_lutimes.S +++ b/libc/sysv/calls/sys_lutimes.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_lutimes,0x1a8fff114fffffff,0xfff,globl,hidden +.scall sys_lutimes,0x1a8fff114fffffff,4095,4095,globl,hidden diff --git a/libc/sysv/calls/sys_madvise.S b/libc/sysv/calls/sys_madvise.S index c7ec94f9a..5ebd416b3 100644 --- a/libc/sysv/calls/sys_madvise.S +++ b/libc/sysv/calls/sys_madvise.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_madvise,0x04b04b04b204b01c,0x0e9,globl,hidden +.scall sys_madvise,0x04b04b04b204b01c,233,75,globl,hidden diff --git a/libc/sysv/calls/sys_mbind.S b/libc/sysv/calls/sys_mbind.S index d855d8eca..1229b8a33 100644 --- a/libc/sysv/calls/sys_mbind.S +++ b/libc/sysv/calls/sys_mbind.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_mbind,0xfffffffffffff0ed,0x0eb,globl +.scall sys_mbind,0xfffffffffffff0ed,235,4095,globl diff --git a/libc/sysv/calls/sys_membarrier.S b/libc/sysv/calls/sys_membarrier.S index cebb63679..4abba677a 100644 --- a/libc/sysv/calls/sys_membarrier.S +++ b/libc/sysv/calls/sys_membarrier.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_membarrier,0xfffffffffffff144,0x11b,globl +.scall sys_membarrier,0xfffffffffffff144,283,4095,globl diff --git a/libc/sysv/calls/sys_memfd_create.S b/libc/sysv/calls/sys_memfd_create.S index 621de7c65..dc05605ab 100644 --- a/libc/sysv/calls/sys_memfd_create.S +++ b/libc/sysv/calls/sys_memfd_create.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_memfd_create,0xfffffffffffff13f,0x117,globl,hidden +.scall sys_memfd_create,0xfffffffffffff13f,279,4095,globl,hidden diff --git a/libc/sysv/calls/sys_memfd_secret.S b/libc/sysv/calls/sys_memfd_secret.S index 45e92eb0e..82d15f10b 100644 --- a/libc/sysv/calls/sys_memfd_secret.S +++ b/libc/sysv/calls/sys_memfd_secret.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_memfd_secret,0xfffffffffffff1bf,0xfff,globl +.scall sys_memfd_secret,0xfffffffffffff1bf,4095,4095,globl diff --git a/libc/sysv/calls/sys_migrate_pages.S b/libc/sysv/calls/sys_migrate_pages.S index 925f05b85..416f1b2d6 100644 --- a/libc/sysv/calls/sys_migrate_pages.S +++ b/libc/sysv/calls/sys_migrate_pages.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_migrate_pages,0xfffffffffffff100,0x0ee,globl +.scall sys_migrate_pages,0xfffffffffffff100,238,4095,globl diff --git a/libc/sysv/calls/sys_mincore.S b/libc/sysv/calls/sys_mincore.S index 5aefbd5c0..fb14df037 100644 --- a/libc/sysv/calls/sys_mincore.S +++ b/libc/sysv/calls/sys_mincore.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_mincore,0x04e04e04e204e01b,0x0e8,globl,hidden +.scall sys_mincore,0x04e04e04e204e01b,232,78,globl,hidden diff --git a/libc/sysv/calls/sys_minherit.S b/libc/sysv/calls/sys_minherit.S index 784c8953e..a2a79223b 100644 --- a/libc/sysv/calls/sys_minherit.S +++ b/libc/sysv/calls/sys_minherit.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_minherit,0x1110fa0fa20fafff,0xfff,globl +.scall sys_minherit,0x1110fa0fa20fafff,4095,250,globl diff --git a/libc/sysv/calls/sys_mkdirat.S b/libc/sysv/calls/sys_mkdirat.S index 0e0adec64..a9097d275 100644 --- a/libc/sysv/calls/sys_mkdirat.S +++ b/libc/sysv/calls/sys_mkdirat.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_mkdirat,0x1cd13e1f021db102,0x022,globl,hidden +.scall sys_mkdirat,0x1cd13e1f021db102,34,475,globl,hidden diff --git a/libc/sysv/calls/sys_mkfifo.S b/libc/sysv/calls/sys_mkfifo.S index 59fbab005..3223e1cb9 100644 --- a/libc/sysv/calls/sys_mkfifo.S +++ b/libc/sysv/calls/sys_mkfifo.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_mkfifo,0x0840840842084fff,0xfff,globl,hidden +.scall sys_mkfifo,0x0840840842084fff,4095,132,globl,hidden diff --git a/libc/sysv/calls/sys_mkfifoat.S b/libc/sysv/calls/sys_mkfifoat.S index 54ecc76b1..9cfd6cf8a 100644 --- a/libc/sysv/calls/sys_mkfifoat.S +++ b/libc/sysv/calls/sys_mkfifoat.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_mkfifoat,0x1cb13f1f1fffffff,0xfff,globl +.scall sys_mkfifoat,0x1cb13f1f1fffffff,4095,4095,globl diff --git a/libc/sysv/calls/sys_mknod.S b/libc/sysv/calls/sys_mknod.S index 3b7c4ffe3..7769ec759 100644 --- a/libc/sysv/calls/sys_mknod.S +++ b/libc/sysv/calls/sys_mknod.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_mknod,0x1c200e00e200e085,0xfff,globl,hidden +.scall sys_mknod,0x1c200e00e200e085,4095,14,globl,hidden diff --git a/libc/sysv/calls/sys_mknodat.S b/libc/sysv/calls/sys_mknodat.S index f0807c409..2861d0d7b 100644 --- a/libc/sysv/calls/sys_mknodat.S +++ b/libc/sysv/calls/sys_mknodat.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_mknodat,0x1cc14022fffff103,0x021,globl +.scall sys_mknodat,0x1cc14022fffff103,33,4095,globl diff --git a/libc/sysv/calls/sys_mlock.S b/libc/sysv/calls/sys_mlock.S index 4486a6612..585fd758f 100644 --- a/libc/sysv/calls/sys_mlock.S +++ b/libc/sysv/calls/sys_mlock.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_mlock,0x0cb0cb0cb20cb095,0x0e4,globl +.scall sys_mlock,0x0cb0cb0cb20cb095,228,203,globl diff --git a/libc/sysv/calls/sys_mlock2.S b/libc/sysv/calls/sys_mlock2.S index 207df488d..53abd55c1 100644 --- a/libc/sysv/calls/sys_mlock2.S +++ b/libc/sysv/calls/sys_mlock2.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_mlock2,0xfffffffffffff145,0x11c,globl +.scall sys_mlock2,0xfffffffffffff145,284,4095,globl diff --git a/libc/sysv/calls/sys_mlockall.S b/libc/sysv/calls/sys_mlockall.S index 06a46768f..0cadfc2b3 100644 --- a/libc/sysv/calls/sys_mlockall.S +++ b/libc/sysv/calls/sys_mlockall.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_mlockall,0x0f210f1442144097,0x0e6,globl +.scall sys_mlockall,0x0f210f1442144097,230,324,globl diff --git a/libc/sysv/calls/sys_modify_ldt.S b/libc/sysv/calls/sys_modify_ldt.S index 83cdfc4f0..2a7a098a2 100644 --- a/libc/sysv/calls/sys_modify_ldt.S +++ b/libc/sysv/calls/sys_modify_ldt.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_modify_ldt,0xfffffffffffff09a,0xfff,globl +.scall sys_modify_ldt,0xfffffffffffff09a,4095,4095,globl diff --git a/libc/sysv/calls/sys_mount.S b/libc/sysv/calls/sys_mount.S index ab40ceeef..9b84e8f1d 100644 --- a/libc/sysv/calls/sys_mount.S +++ b/libc/sysv/calls/sys_mount.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_mount,0x19a01501520a70a5,0x028,globl,hidden +.scall sys_mount,0x19a01501520a70a5,40,167,globl,hidden diff --git a/libc/sysv/calls/sys_mount_setattr.S b/libc/sysv/calls/sys_mount_setattr.S index 5f96b867d..4c54af120 100644 --- a/libc/sysv/calls/sys_mount_setattr.S +++ b/libc/sysv/calls/sys_mount_setattr.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_mount_setattr,0xfffffffffffff1ba,0x1ba,globl +.scall sys_mount_setattr,0xfffffffffffff1ba,442,4095,globl diff --git a/libc/sysv/calls/sys_move_mount.S b/libc/sysv/calls/sys_move_mount.S index 0f8347e3f..0357d0731 100644 --- a/libc/sysv/calls/sys_move_mount.S +++ b/libc/sysv/calls/sys_move_mount.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_move_mount,0xfffffffffffff1ad,0x1ad,globl +.scall sys_move_mount,0xfffffffffffff1ad,429,4095,globl diff --git a/libc/sysv/calls/sys_move_pages.S b/libc/sysv/calls/sys_move_pages.S index 4ab16b055..84c4d72b8 100644 --- a/libc/sysv/calls/sys_move_pages.S +++ b/libc/sysv/calls/sys_move_pages.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_move_pages,0xfffffffffffff117,0x0ef,globl +.scall sys_move_pages,0xfffffffffffff117,239,4095,globl diff --git a/libc/sysv/calls/sys_mprotect.S b/libc/sysv/calls/sys_mprotect.S index 2b33e8844..27e1e70b4 100644 --- a/libc/sysv/calls/sys_mprotect.S +++ b/libc/sysv/calls/sys_mprotect.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_mprotect,0x04a04a04a204a00a,0x0e2,globl,hidden +.scall sys_mprotect,0x04a04a04a204a00a,226,74,globl,hidden diff --git a/libc/sysv/calls/sys_mq_getsetattr.S b/libc/sysv/calls/sys_mq_getsetattr.S index 3c9d04c2c..704d2af23 100644 --- a/libc/sysv/calls/sys_mq_getsetattr.S +++ b/libc/sysv/calls/sys_mq_getsetattr.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_mq_getsetattr,0xfffffffffffff0f5,0x0b9,globl +.scall sys_mq_getsetattr,0xfffffffffffff0f5,185,4095,globl diff --git a/libc/sysv/calls/sys_mq_notify.S b/libc/sysv/calls/sys_mq_notify.S index 5c2704849..833cf7c31 100644 --- a/libc/sysv/calls/sys_mq_notify.S +++ b/libc/sysv/calls/sys_mq_notify.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_mq_notify,0x106ffffffffff0f4,0x0b8,globl +.scall sys_mq_notify,0x106ffffffffff0f4,184,4095,globl diff --git a/libc/sysv/calls/sys_mq_open.S b/libc/sysv/calls/sys_mq_open.S index e3efb1731..126a1070e 100644 --- a/libc/sysv/calls/sys_mq_open.S +++ b/libc/sysv/calls/sys_mq_open.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_mq_open,0x101ffffffffff0f0,0x0b4,globl +.scall sys_mq_open,0x101ffffffffff0f0,180,4095,globl diff --git a/libc/sysv/calls/sys_mq_timedreceive.S b/libc/sysv/calls/sys_mq_timedreceive.S index 29f8f2a35..e99711f8d 100644 --- a/libc/sysv/calls/sys_mq_timedreceive.S +++ b/libc/sysv/calls/sys_mq_timedreceive.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_mq_timedreceive,0x1b1ffffffffff0f3,0x0b7,globl +.scall sys_mq_timedreceive,0x1b1ffffffffff0f3,183,4095,globl diff --git a/libc/sysv/calls/sys_mq_timedsend.S b/libc/sysv/calls/sys_mq_timedsend.S index bb05514c9..f3cc52075 100644 --- a/libc/sysv/calls/sys_mq_timedsend.S +++ b/libc/sysv/calls/sys_mq_timedsend.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_mq_timedsend,0x1b0ffffffffff0f2,0x0b6,globl +.scall sys_mq_timedsend,0x1b0ffffffffff0f2,182,4095,globl diff --git a/libc/sysv/calls/sys_mq_unlink.S b/libc/sysv/calls/sys_mq_unlink.S index d1c7baf7e..349e504a9 100644 --- a/libc/sysv/calls/sys_mq_unlink.S +++ b/libc/sysv/calls/sys_mq_unlink.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_mq_unlink,0x103ffffffffff0f1,0x0b5,globl +.scall sys_mq_unlink,0x103ffffffffff0f1,181,4095,globl diff --git a/libc/sysv/calls/sys_msgctl.S b/libc/sysv/calls/sys_msgctl.S index 4a21cf3b6..aa8c185a6 100644 --- a/libc/sysv/calls/sys_msgctl.S +++ b/libc/sysv/calls/sys_msgctl.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_msgctl,0x1bc1291ff2102047,0x0bb,globl +.scall sys_msgctl,0x1bc1291ff2102047,187,258,globl diff --git a/libc/sysv/calls/sys_msgget.S b/libc/sysv/calls/sys_msgget.S index 00b63d759..e755bd17e 100644 --- a/libc/sysv/calls/sys_msgget.S +++ b/libc/sysv/calls/sys_msgget.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_msgget,0x0e10e10e12103044,0x0ba,globl +.scall sys_msgget,0x0e10e10e12103044,186,259,globl diff --git a/libc/sysv/calls/sys_msgrcv.S b/libc/sysv/calls/sys_msgrcv.S index 9b3fb5b0e..3860fc01d 100644 --- a/libc/sysv/calls/sys_msgrcv.S +++ b/libc/sysv/calls/sys_msgrcv.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_msgrcv,0x8e38e38e32905846,0x0bc,globl +.scall sys_msgrcv,0x8e38e38e32905846,188,261,globl diff --git a/libc/sysv/calls/sys_msgsnd.S b/libc/sysv/calls/sys_msgsnd.S index 9c398b7b2..7262e2b40 100644 --- a/libc/sysv/calls/sys_msgsnd.S +++ b/libc/sysv/calls/sys_msgsnd.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_msgsnd,0x8e28e28e22904845,0x0bd,globl +.scall sys_msgsnd,0x8e28e28e22904845,189,260,globl diff --git a/libc/sysv/calls/sys_msgsys.S b/libc/sysv/calls/sys_msgsys.S index e33234692..81d9ff424 100644 --- a/libc/sysv/calls/sys_msgsys.S +++ b/libc/sysv/calls/sys_msgsys.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_msgsys,0xffffff0aa20fcfff,0xfff,globl +.scall sys_msgsys,0xffffff0aa20fcfff,4095,252,globl diff --git a/libc/sysv/calls/sys_msync.S b/libc/sysv/calls/sys_msync.S index 2644aeba6..a4461481a 100644 --- a/libc/sysv/calls/sys_msync.S +++ b/libc/sysv/calls/sys_msync.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_msync,0x915900841284181a,0x0e3,globl,hidden +.scall sys_msync,0x915900841284181a,227,65,globl,hidden diff --git a/libc/sysv/calls/sys_msyscall.S b/libc/sysv/calls/sys_msyscall.S index d04c16d9b..28f88858b 100644 --- a/libc/sysv/calls/sys_msyscall.S +++ b/libc/sysv/calls/sys_msyscall.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_msyscall,0xfff025ffffffffff,0xfff,globl +.scall sys_msyscall,0xfff025ffffffffff,4095,4095,globl diff --git a/libc/sysv/calls/sys_munlock.S b/libc/sysv/calls/sys_munlock.S index e6a8d2fae..e6e48cf22 100644 --- a/libc/sysv/calls/sys_munlock.S +++ b/libc/sysv/calls/sys_munlock.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_munlock,0x0cc0cc0cc20cc096,0x0e5,globl +.scall sys_munlock,0x0cc0cc0cc20cc096,229,204,globl diff --git a/libc/sysv/calls/sys_munlockall.S b/libc/sysv/calls/sys_munlockall.S index 0baf24310..f57c6edb4 100644 --- a/libc/sysv/calls/sys_munlockall.S +++ b/libc/sysv/calls/sys_munlockall.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_munlockall,0x0f31101452145098,0x0e7,globl +.scall sys_munlockall,0x0f31101452145098,231,325,globl diff --git a/libc/sysv/calls/sys_name_to_handle_at.S b/libc/sysv/calls/sys_name_to_handle_at.S index 57092ffc5..bf4b9621b 100644 --- a/libc/sysv/calls/sys_name_to_handle_at.S +++ b/libc/sysv/calls/sys_name_to_handle_at.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_name_to_handle_at,0xfffffffffffff12f,0x108,globl +.scall sys_name_to_handle_at,0xfffffffffffff12f,264,4095,globl diff --git a/libc/sysv/calls/sys_nanosleep.S b/libc/sysv/calls/sys_nanosleep.S index efef47332..7d8488688 100644 --- a/libc/sysv/calls/sys_nanosleep.S +++ b/libc/sysv/calls/sys_nanosleep.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_nanosleep,0x9ae85b8f0ffff823,0x065,globl,hidden +.scall sys_nanosleep,0x9ae85b8f0ffff823,101,4095,globl,hidden diff --git a/libc/sysv/calls/sys_nfssvc.S b/libc/sysv/calls/sys_nfssvc.S index 0f6a9570e..449e05082 100644 --- a/libc/sysv/calls/sys_nfssvc.S +++ b/libc/sysv/calls/sys_nfssvc.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_nfssvc,0x09b09b09b209bfff,0xfff,globl +.scall sys_nfssvc,0x09b09b09b209bfff,4095,155,globl diff --git a/libc/sysv/calls/sys_ntp_adjtime.S b/libc/sysv/calls/sys_ntp_adjtime.S index b401cd1de..5bf0816ae 100644 --- a/libc/sysv/calls/sys_ntp_adjtime.S +++ b/libc/sysv/calls/sys_ntp_adjtime.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_ntp_adjtime,0x0b0fff0b0220ffff,0xfff,globl +.scall sys_ntp_adjtime,0x0b0fff0b0220ffff,4095,527,globl diff --git a/libc/sysv/calls/sys_ntp_gettime.S b/libc/sysv/calls/sys_ntp_gettime.S index 80d08b495..889ed8237 100644 --- a/libc/sysv/calls/sys_ntp_gettime.S +++ b/libc/sysv/calls/sys_ntp_gettime.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_ntp_gettime,0x1c0fff0f82210fff,0xfff,globl +.scall sys_ntp_gettime,0x1c0fff0f82210fff,4095,528,globl diff --git a/libc/sysv/calls/sys_open.S b/libc/sysv/calls/sys_open.S index 993e1b233..3a436c36e 100644 --- a/libc/sysv/calls/sys_open.S +++ b/libc/sysv/calls/sys_open.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_open,0x8058058052805802,0x0b4,globl,hidden +.scall sys_open,0x8058058052805802,180,5,globl,hidden diff --git a/libc/sysv/calls/sys_open_by_handle_at.S b/libc/sysv/calls/sys_open_by_handle_at.S index 1189d6140..da2a04e8e 100644 --- a/libc/sysv/calls/sys_open_by_handle_at.S +++ b/libc/sysv/calls/sys_open_by_handle_at.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_open_by_handle_at,0xfffffffffffff130,0x109,globl +.scall sys_open_by_handle_at,0xfffffffffffff130,265,4095,globl diff --git a/libc/sysv/calls/sys_open_tree.S b/libc/sysv/calls/sys_open_tree.S index f39ec6ec5..f1c42def4 100644 --- a/libc/sysv/calls/sys_open_tree.S +++ b/libc/sysv/calls/sys_open_tree.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_open_tree,0xfffffffffffff1ac,0x1ac,globl +.scall sys_open_tree,0xfffffffffffff1ac,428,4095,globl diff --git a/libc/sysv/calls/sys_openat2.S b/libc/sysv/calls/sys_openat2.S index 7a5d4f380..a3f5683ae 100644 --- a/libc/sysv/calls/sys_openat2.S +++ b/libc/sysv/calls/sys_openat2.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_openat2,0xfffffffffffff1b5,0x1b5,globl,hidden +.scall sys_openat2,0xfffffffffffff1b5,437,4095,globl,hidden diff --git a/libc/sysv/calls/sys_pathconf.S b/libc/sysv/calls/sys_pathconf.S index 14fe95dad..f9c50f944 100644 --- a/libc/sysv/calls/sys_pathconf.S +++ b/libc/sysv/calls/sys_pathconf.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_pathconf,0x0bf0bf0bf20bffff,0xfff,globl +.scall sys_pathconf,0x0bf0bf0bf20bffff,4095,191,globl diff --git a/libc/sysv/calls/sys_pause.S b/libc/sysv/calls/sys_pause.S index 92ec87b10..b55115c36 100644 --- a/libc/sysv/calls/sys_pause.S +++ b/libc/sysv/calls/sys_pause.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_pause,0xfffffffffffff022,0xfff,globl,hidden +.scall sys_pause,0xfffffffffffff022,4095,4095,globl,hidden diff --git a/libc/sysv/calls/sys_perf_event_open.S b/libc/sysv/calls/sys_perf_event_open.S index 3a8bee54f..81299e1fd 100644 --- a/libc/sysv/calls/sys_perf_event_open.S +++ b/libc/sysv/calls/sys_perf_event_open.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_perf_event_open,0xfffffffffffff12a,0x0f1,globl +.scall sys_perf_event_open,0xfffffffffffff12a,241,4095,globl diff --git a/libc/sysv/calls/sys_personality.S b/libc/sysv/calls/sys_personality.S index b15a731ac..4daaf297f 100644 --- a/libc/sysv/calls/sys_personality.S +++ b/libc/sysv/calls/sys_personality.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_personality,0xfffffffffffff087,0x05c,globl +.scall sys_personality,0xfffffffffffff087,92,4095,globl diff --git a/libc/sysv/calls/sys_pidfd_getfd.S b/libc/sysv/calls/sys_pidfd_getfd.S index 047f9cb40..eeec18921 100644 --- a/libc/sysv/calls/sys_pidfd_getfd.S +++ b/libc/sysv/calls/sys_pidfd_getfd.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_pidfd_getfd,0xfffffffffffff1b6,0x1b6,globl +.scall sys_pidfd_getfd,0xfffffffffffff1b6,438,4095,globl diff --git a/libc/sysv/calls/sys_pidfd_open.S b/libc/sysv/calls/sys_pidfd_open.S index 747d0fe84..aee59dc4e 100644 --- a/libc/sysv/calls/sys_pidfd_open.S +++ b/libc/sysv/calls/sys_pidfd_open.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_pidfd_open,0xfffffffffffff1b2,0x1b2,globl +.scall sys_pidfd_open,0xfffffffffffff1b2,434,4095,globl diff --git a/libc/sysv/calls/sys_pidfd_send_signal.S b/libc/sysv/calls/sys_pidfd_send_signal.S index 593572bef..2859d9f44 100644 --- a/libc/sysv/calls/sys_pidfd_send_signal.S +++ b/libc/sysv/calls/sys_pidfd_send_signal.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_pidfd_send_signal,0xfffffffffffff1a8,0x1a8,globl +.scall sys_pidfd_send_signal,0xfffffffffffff1a8,424,4095,globl diff --git a/libc/sysv/calls/sys_pivot_root.S b/libc/sysv/calls/sys_pivot_root.S index 3e9b0bc2b..5bd38ad42 100644 --- a/libc/sysv/calls/sys_pivot_root.S +++ b/libc/sysv/calls/sys_pivot_root.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_pivot_root,0xfffffffffffff09b,0x029,globl,hidden +.scall sys_pivot_root,0xfffffffffffff09b,41,4095,globl,hidden diff --git a/libc/sysv/calls/sys_pkey_alloc.S b/libc/sysv/calls/sys_pkey_alloc.S index 38ec7ebb7..95f22c192 100644 --- a/libc/sysv/calls/sys_pkey_alloc.S +++ b/libc/sysv/calls/sys_pkey_alloc.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_pkey_alloc,0xfffffffffffff14a,0x121,globl +.scall sys_pkey_alloc,0xfffffffffffff14a,289,4095,globl diff --git a/libc/sysv/calls/sys_pkey_free.S b/libc/sysv/calls/sys_pkey_free.S index f05bbf9dd..78c1ad586 100644 --- a/libc/sysv/calls/sys_pkey_free.S +++ b/libc/sysv/calls/sys_pkey_free.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_pkey_free,0xfffffffffffff14b,0x122,globl +.scall sys_pkey_free,0xfffffffffffff14b,290,4095,globl diff --git a/libc/sysv/calls/sys_pkey_mprotect.S b/libc/sysv/calls/sys_pkey_mprotect.S index 3e7785597..17354fb69 100644 --- a/libc/sysv/calls/sys_pkey_mprotect.S +++ b/libc/sysv/calls/sys_pkey_mprotect.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_pkey_mprotect,0xfffffffffffff149,0x120,globl +.scall sys_pkey_mprotect,0xfffffffffffff149,288,4095,globl diff --git a/libc/sysv/calls/sys_pledge.S b/libc/sysv/calls/sys_pledge.S index d503e9590..7eec22693 100644 --- a/libc/sysv/calls/sys_pledge.S +++ b/libc/sysv/calls/sys_pledge.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_pledge,0xfff06cffffffffff,0xfff,globl,hidden +.scall sys_pledge,0xfff06cffffffffff,4095,4095,globl,hidden diff --git a/libc/sysv/calls/sys_posix_openpt.S b/libc/sysv/calls/sys_posix_openpt.S index fd676a7ab..2e2c7276f 100644 --- a/libc/sysv/calls/sys_posix_openpt.S +++ b/libc/sysv/calls/sys_posix_openpt.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_posix_openpt,0xffffff1f8fffffff,0xfff,globl,hidden +.scall sys_posix_openpt,0xffffff1f8fffffff,4095,4095,globl,hidden diff --git a/libc/sysv/calls/sys_posix_spawn.S b/libc/sysv/calls/sys_posix_spawn.S index 48f7ce84d..a1124c2e7 100644 --- a/libc/sysv/calls/sys_posix_spawn.S +++ b/libc/sysv/calls/sys_posix_spawn.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_posix_spawn,0x1daffffff20f4fff,0xfff,globl,hidden +.scall sys_posix_spawn,0x1daffffff20f4fff,4095,244,globl,hidden diff --git a/libc/sysv/calls/sys_ppoll.S b/libc/sysv/calls/sys_ppoll.S index 6febdd82c..88c0025d5 100644 --- a/libc/sysv/calls/sys_ppoll.S +++ b/libc/sysv/calls/sys_ppoll.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_ppoll,0xfff86da21ffff90f,0x049,globl,hidden +.scall sys_ppoll,0xfff86da21ffff90f,73,4095,globl,hidden diff --git a/libc/sysv/calls/sys_pread.S b/libc/sysv/calls/sys_pread.S index 045da6aed..3e5c635f7 100644 --- a/libc/sysv/calls/sys_pread.S +++ b/libc/sysv/calls/sys_pread.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_pread,0x8ad8ad9db2899811,0x043,globl,hidden +.scall sys_pread,0x8ad8ad9db2899811,67,153,globl,hidden diff --git a/libc/sysv/calls/sys_preadv.S b/libc/sysv/calls/sys_preadv.S index 518c3710c..5c8c1d5b9 100644 --- a/libc/sysv/calls/sys_preadv.S +++ b/libc/sysv/calls/sys_preadv.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_preadv,0x92190b9212a1c927,0x045,globl,hidden +.scall sys_preadv,0x92190b9212a1c927,69,540,globl,hidden diff --git a/libc/sysv/calls/sys_preadv2.S b/libc/sysv/calls/sys_preadv2.S index ef5724ba0..8967aa41f 100644 --- a/libc/sysv/calls/sys_preadv2.S +++ b/libc/sysv/calls/sys_preadv2.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_preadv2,0xfffffffffffff147,0x11e,globl +.scall sys_preadv2,0xfffffffffffff147,286,4095,globl diff --git a/libc/sysv/calls/sys_prlimit.S b/libc/sysv/calls/sys_prlimit.S index 506b6a78d..69c1b9435 100644 --- a/libc/sysv/calls/sys_prlimit.S +++ b/libc/sysv/calls/sys_prlimit.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_prlimit,0xfffffffffffff12e,0x105,globl +.scall sys_prlimit,0xfffffffffffff12e,261,4095,globl diff --git a/libc/sysv/calls/sys_process_madvise.S b/libc/sysv/calls/sys_process_madvise.S index e4d43027a..2a09adb19 100644 --- a/libc/sysv/calls/sys_process_madvise.S +++ b/libc/sysv/calls/sys_process_madvise.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_process_madvise,0xfffffffffffff1b8,0x1b8,globl +.scall sys_process_madvise,0xfffffffffffff1b8,440,4095,globl diff --git a/libc/sysv/calls/sys_process_mrelease.S b/libc/sysv/calls/sys_process_mrelease.S index e84394dcd..e284b255a 100644 --- a/libc/sysv/calls/sys_process_mrelease.S +++ b/libc/sysv/calls/sys_process_mrelease.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_process_mrelease,0xfffffffffffff1c0,0xfff,globl +.scall sys_process_mrelease,0xfffffffffffff1c0,4095,4095,globl diff --git a/libc/sysv/calls/sys_process_vm_readv.S b/libc/sysv/calls/sys_process_vm_readv.S index e0119cae2..4987f98e1 100644 --- a/libc/sysv/calls/sys_process_vm_readv.S +++ b/libc/sysv/calls/sys_process_vm_readv.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_process_vm_readv,0xfffffffffffff136,0x10e,globl +.scall sys_process_vm_readv,0xfffffffffffff136,270,4095,globl diff --git a/libc/sysv/calls/sys_process_vm_writev.S b/libc/sysv/calls/sys_process_vm_writev.S index 553e4897a..11f7c2aa4 100644 --- a/libc/sysv/calls/sys_process_vm_writev.S +++ b/libc/sysv/calls/sys_process_vm_writev.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_process_vm_writev,0xfffffffffffff137,0x10f,globl +.scall sys_process_vm_writev,0xfffffffffffff137,271,4095,globl diff --git a/libc/sysv/calls/sys_profil.S b/libc/sysv/calls/sys_profil.S index 724eaaa81..f4cb80bf9 100644 --- a/libc/sysv/calls/sys_profil.S +++ b/libc/sysv/calls/sys_profil.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_profil,0x02c02c02cfffffff,0xfff,globl +.scall sys_profil,0x02c02c02cfffffff,4095,4095,globl diff --git a/libc/sysv/calls/sys_pselect.S b/libc/sysv/calls/sys_pselect.S index c677b9c8b..ffd50cd85 100644 --- a/libc/sysv/calls/sys_pselect.S +++ b/libc/sysv/calls/sys_pselect.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_pselect,0x9b486ea0a298a90e,0x048,globl,hidden +.scall sys_pselect,0x9b486ea0a298a90e,72,394,globl,hidden diff --git a/libc/sysv/calls/sys_pwrite.S b/libc/sysv/calls/sys_pwrite.S index 267efb1dd..7493fbecf 100644 --- a/libc/sysv/calls/sys_pwrite.S +++ b/libc/sysv/calls/sys_pwrite.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_pwrite,0x8ae8ae9dc289a812,0x044,globl,hidden +.scall sys_pwrite,0x8ae8ae9dc289a812,68,154,globl,hidden diff --git a/libc/sysv/calls/sys_pwritev.S b/libc/sysv/calls/sys_pwritev.S index d9dc467a6..c4338ef62 100644 --- a/libc/sysv/calls/sys_pwritev.S +++ b/libc/sysv/calls/sys_pwritev.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_pwritev,0x92290c9222a1d928,0x046,globl,hidden +.scall sys_pwritev,0x92290c9222a1d928,70,541,globl,hidden diff --git a/libc/sysv/calls/sys_pwritev2.S b/libc/sysv/calls/sys_pwritev2.S index 9bf675d10..7157c74ad 100644 --- a/libc/sysv/calls/sys_pwritev2.S +++ b/libc/sysv/calls/sys_pwritev2.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_pwritev2,0xfffffffffffff148,0x11f,globl +.scall sys_pwritev2,0xfffffffffffff148,287,4095,globl diff --git a/libc/sysv/calls/sys_quotactl.S b/libc/sysv/calls/sys_quotactl.S index 006ece2fa..2e4c7b3fa 100644 --- a/libc/sysv/calls/sys_quotactl.S +++ b/libc/sysv/calls/sys_quotactl.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_quotactl,0xfff09409420a50b3,0x03c,globl +.scall sys_quotactl,0xfff09409420a50b3,60,165,globl diff --git a/libc/sysv/calls/sys_quotactl_fd.S b/libc/sysv/calls/sys_quotactl_fd.S index 4a9768233..e3e3a6b7b 100644 --- a/libc/sysv/calls/sys_quotactl_fd.S +++ b/libc/sysv/calls/sys_quotactl_fd.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_quotactl_fd,0xfffffffffffff1bb,0xfff,globl +.scall sys_quotactl_fd,0xfffffffffffff1bb,4095,4095,globl diff --git a/libc/sysv/calls/sys_read.S b/libc/sysv/calls/sys_read.S index 54c434f38..81668006a 100644 --- a/libc/sysv/calls/sys_read.S +++ b/libc/sysv/calls/sys_read.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_read,0x8038038032803800,0x03f,globl,hidden +.scall sys_read,0x8038038032803800,63,3,globl,hidden diff --git a/libc/sysv/calls/sys_readahead.S b/libc/sysv/calls/sys_readahead.S index c3c150efb..7fa5888fb 100644 --- a/libc/sysv/calls/sys_readahead.S +++ b/libc/sysv/calls/sys_readahead.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_readahead,0xfffffffffffff0bb,0x0d5,globl +.scall sys_readahead,0xfffffffffffff0bb,213,4095,globl diff --git a/libc/sysv/calls/sys_readlinkat.S b/libc/sysv/calls/sys_readlinkat.S index 70b91c70a..2c5118429 100644 --- a/libc/sysv/calls/sys_readlinkat.S +++ b/libc/sysv/calls/sys_readlinkat.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_readlinkat,0x1d51421f421d910b,0x04e,globl,hidden +.scall sys_readlinkat,0x1d51421f421d910b,78,473,globl,hidden diff --git a/libc/sysv/calls/sys_readv.S b/libc/sysv/calls/sys_readv.S index d9cd4774a..65984cba7 100644 --- a/libc/sysv/calls/sys_readv.S +++ b/libc/sysv/calls/sys_readv.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_readv,0x8788788782878813,0x041,globl,hidden +.scall sys_readv,0x8788788782878813,65,120,globl,hidden diff --git a/libc/sysv/calls/sys_reboot.S b/libc/sysv/calls/sys_reboot.S index d8af8baf9..5da5b778b 100644 --- a/libc/sysv/calls/sys_reboot.S +++ b/libc/sysv/calls/sys_reboot.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_reboot,0x0d003703720370a9,0x08e,globl,hidden +.scall sys_reboot,0x0d003703720370a9,142,55,globl,hidden diff --git a/libc/sysv/calls/sys_recvfrom.S b/libc/sysv/calls/sys_recvfrom.S index 91a2207ab..b40f1179f 100644 --- a/libc/sysv/calls/sys_recvfrom.S +++ b/libc/sysv/calls/sys_recvfrom.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_recvfrom,0x81d81d81d281d82d,0x0cf,globl,hidden +.scall sys_recvfrom,0x81d81d81d281d82d,207,29,globl,hidden diff --git a/libc/sysv/calls/sys_recvmmsg.S b/libc/sysv/calls/sys_recvmmsg.S index 167ba803b..85f1a968e 100644 --- a/libc/sysv/calls/sys_recvmmsg.S +++ b/libc/sysv/calls/sys_recvmmsg.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_recvmmsg,0x1dbffffffffff12b,0x0f3,globl +.scall sys_recvmmsg,0x1dbffffffffff12b,243,4095,globl diff --git a/libc/sysv/calls/sys_recvmsg.S b/libc/sysv/calls/sys_recvmsg.S index 526817bc0..17e42ef7f 100644 --- a/libc/sysv/calls/sys_recvmsg.S +++ b/libc/sysv/calls/sys_recvmsg.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_recvmsg,0x81b81b81b281b82f,0x0d4,globl,hidden +.scall sys_recvmsg,0x81b81b81b281b82f,212,27,globl,hidden diff --git a/libc/sysv/calls/sys_removexattr.S b/libc/sysv/calls/sys_removexattr.S index ec6fa6d02..7300cf2ba 100644 --- a/libc/sysv/calls/sys_removexattr.S +++ b/libc/sysv/calls/sys_removexattr.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_removexattr,0x180ffffff20ee0c5,0x00e,globl +.scall sys_removexattr,0x180ffffff20ee0c5,14,238,globl diff --git a/libc/sysv/calls/sys_renameat.S b/libc/sysv/calls/sys_renameat.S index 1e7b432ee..e17098c0f 100644 --- a/libc/sysv/calls/sys_renameat.S +++ b/libc/sysv/calls/sys_renameat.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_renameat,0x1ca1431f521d1108,0x026,globl,hidden +.scall sys_renameat,0x1ca1431f521d1108,38,465,globl,hidden diff --git a/libc/sysv/calls/sys_renameat2.S b/libc/sysv/calls/sys_renameat2.S index d669e91c2..0d1353123 100644 --- a/libc/sysv/calls/sys_renameat2.S +++ b/libc/sysv/calls/sys_renameat2.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_renameat2,0xfffffffffffff13c,0x114,globl +.scall sys_renameat2,0xfffffffffffff13c,276,4095,globl diff --git a/libc/sysv/calls/sys_request_key.S b/libc/sysv/calls/sys_request_key.S index c71a658ce..f69e9dc92 100644 --- a/libc/sysv/calls/sys_request_key.S +++ b/libc/sysv/calls/sys_request_key.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_request_key,0xfffffffffffff0f9,0x0da,globl +.scall sys_request_key,0xfffffffffffff0f9,218,4095,globl diff --git a/libc/sysv/calls/sys_restart_syscall.S b/libc/sysv/calls/sys_restart_syscall.S index 585d7d433..44b511cca 100644 --- a/libc/sysv/calls/sys_restart_syscall.S +++ b/libc/sysv/calls/sys_restart_syscall.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_restart_syscall,0xfffffffffffff0db,0x080,globl +.scall sys_restart_syscall,0xfffffffffffff0db,128,4095,globl diff --git a/libc/sysv/calls/sys_revoke.S b/libc/sysv/calls/sys_revoke.S index 5d99c9ff0..0e53177c6 100644 --- a/libc/sysv/calls/sys_revoke.S +++ b/libc/sysv/calls/sys_revoke.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_revoke,0x0380380382038fff,0xfff,globl +.scall sys_revoke,0x0380380382038fff,4095,56,globl diff --git a/libc/sysv/calls/sys_rseq.S b/libc/sysv/calls/sys_rseq.S index 3fc7ead73..ff9e8d16f 100644 --- a/libc/sysv/calls/sys_rseq.S +++ b/libc/sysv/calls/sys_rseq.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_rseq,0xfffffffffffff14e,0x125,globl +.scall sys_rseq,0xfffffffffffff14e,293,4095,globl diff --git a/libc/sysv/calls/sys_rtprio_thread.S b/libc/sysv/calls/sys_rtprio_thread.S index 690bf7a1e..9abb4dcaf 100644 --- a/libc/sysv/calls/sys_rtprio_thread.S +++ b/libc/sysv/calls/sys_rtprio_thread.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_rtprio_thread,0xffffff1d2fffffff,0xfff,globl +.scall sys_rtprio_thread,0xffffff1d2fffffff,4095,4095,globl diff --git a/libc/sysv/calls/sys_sched_get_priority_max.S b/libc/sysv/calls/sys_sched_get_priority_max.S index b70ba7e8f..c6e09fe26 100644 --- a/libc/sysv/calls/sys_sched_get_priority_max.S +++ b/libc/sysv/calls/sys_sched_get_priority_max.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sched_get_priority_max,0xffffff14cffff092,0x07d,globl,hidden +.scall sys_sched_get_priority_max,0xffffff14cffff092,125,4095,globl,hidden diff --git a/libc/sysv/calls/sys_sched_get_priority_min.S b/libc/sysv/calls/sys_sched_get_priority_min.S index 0db8d8898..f8dcf0fdf 100644 --- a/libc/sysv/calls/sys_sched_get_priority_min.S +++ b/libc/sysv/calls/sys_sched_get_priority_min.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sched_get_priority_min,0xffffff14dffff093,0x07e,globl,hidden +.scall sys_sched_get_priority_min,0xffffff14dffff093,126,4095,globl,hidden diff --git a/libc/sysv/calls/sys_sched_getaffinity.S b/libc/sysv/calls/sys_sched_getaffinity.S index b52a82445..71fdd6583 100644 --- a/libc/sysv/calls/sys_sched_getaffinity.S +++ b/libc/sysv/calls/sys_sched_getaffinity.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sched_getaffinity,0x15dfff1e7ffff0cc,0x07b,globl,hidden +.scall sys_sched_getaffinity,0x15dfff1e7ffff0cc,123,4095,globl,hidden diff --git a/libc/sysv/calls/sys_sched_getattr.S b/libc/sysv/calls/sys_sched_getattr.S index e3fd53b2b..d6e350bb4 100644 --- a/libc/sysv/calls/sys_sched_getattr.S +++ b/libc/sysv/calls/sys_sched_getattr.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sched_getattr,0xfffffffffffff13b,0x113,globl +.scall sys_sched_getattr,0xfffffffffffff13b,275,4095,globl diff --git a/libc/sysv/calls/sys_sched_getparam.S b/libc/sysv/calls/sys_sched_getparam.S index 30b3795d2..71aff76c8 100644 --- a/libc/sysv/calls/sys_sched_getparam.S +++ b/libc/sysv/calls/sys_sched_getparam.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sched_getparam,0x15bfff148ffff08f,0x079,globl,hidden +.scall sys_sched_getparam,0x15bfff148ffff08f,121,4095,globl,hidden diff --git a/libc/sysv/calls/sys_sched_getscheduler.S b/libc/sysv/calls/sys_sched_getscheduler.S index 6ca4ce836..741f7a10a 100644 --- a/libc/sysv/calls/sys_sched_getscheduler.S +++ b/libc/sysv/calls/sys_sched_getscheduler.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sched_getscheduler,0xffffff14affff091,0x078,globl,hidden +.scall sys_sched_getscheduler,0xffffff14affff091,120,4095,globl,hidden diff --git a/libc/sysv/calls/sys_sched_rr_get_interval.S b/libc/sysv/calls/sys_sched_rr_get_interval.S index aa7f63d9c..a517d1781 100644 --- a/libc/sysv/calls/sys_sched_rr_get_interval.S +++ b/libc/sysv/calls/sys_sched_rr_get_interval.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sched_rr_get_interval,0xffffff14effff094,0x07f,globl,hidden +.scall sys_sched_rr_get_interval,0xffffff14effff094,127,4095,globl,hidden diff --git a/libc/sysv/calls/sys_sched_setaffinity.S b/libc/sysv/calls/sys_sched_setaffinity.S index 224a580eb..a5094cd47 100644 --- a/libc/sysv/calls/sys_sched_setaffinity.S +++ b/libc/sysv/calls/sys_sched_setaffinity.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sched_setaffinity,0x15cfff1e8ffff0cb,0x07a,globl,hidden +.scall sys_sched_setaffinity,0x15cfff1e8ffff0cb,122,4095,globl,hidden diff --git a/libc/sysv/calls/sys_sched_setattr.S b/libc/sysv/calls/sys_sched_setattr.S index 31babd196..40d4aa163 100644 --- a/libc/sysv/calls/sys_sched_setattr.S +++ b/libc/sysv/calls/sys_sched_setattr.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sched_setattr,0xfffffffffffff13a,0x112,globl +.scall sys_sched_setattr,0xfffffffffffff13a,274,4095,globl diff --git a/libc/sysv/calls/sys_sched_setparam.S b/libc/sysv/calls/sys_sched_setparam.S index b8a5defbf..d4de11b7f 100644 --- a/libc/sysv/calls/sys_sched_setparam.S +++ b/libc/sysv/calls/sys_sched_setparam.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sched_setparam,0x15afff147ffff08e,0x076,globl,hidden +.scall sys_sched_setparam,0x15afff147ffff08e,118,4095,globl,hidden diff --git a/libc/sysv/calls/sys_sched_setscheduler.S b/libc/sysv/calls/sys_sched_setscheduler.S index 05baf5286..b7f788a32 100644 --- a/libc/sysv/calls/sys_sched_setscheduler.S +++ b/libc/sysv/calls/sys_sched_setscheduler.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sched_setscheduler,0xffffff149ffff090,0x077,globl,hidden +.scall sys_sched_setscheduler,0xffffff149ffff090,119,4095,globl,hidden diff --git a/libc/sysv/calls/sys_sched_yield.S b/libc/sysv/calls/sys_sched_yield.S index ea7f20d16..78360bbf7 100644 --- a/libc/sysv/calls/sys_sched_yield.S +++ b/libc/sysv/calls/sys_sched_yield.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sched_yield,0x15e12a14bf25d018,0x07c,globl,hidden +.scall sys_sched_yield,0x15e12a14bf25d018,124,605,globl,hidden diff --git a/libc/sysv/calls/sys_select.S b/libc/sysv/calls/sys_select.S index 3cc1238a7..a1694c75b 100644 --- a/libc/sysv/calls/sys_select.S +++ b/libc/sysv/calls/sys_select.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_select,0x9a184785d285d817,0xfff,globl,hidden +.scall sys_select,0x9a184785d285d817,4095,93,globl,hidden diff --git a/libc/sysv/calls/sys_sem_close.S b/libc/sysv/calls/sys_sem_close.S index ead40d119..6be3416b8 100644 --- a/libc/sysv/calls/sys_sem_close.S +++ b/libc/sysv/calls/sys_sem_close.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sem_close,0x0fafff190210dfff,0xfff,globl +.scall sys_sem_close,0x0fafff190210dfff,4095,269,globl diff --git a/libc/sysv/calls/sys_sem_destroy.S b/libc/sysv/calls/sys_sem_destroy.S index 04c150c84..ac497e649 100644 --- a/libc/sysv/calls/sys_sem_destroy.S +++ b/libc/sysv/calls/sys_sem_destroy.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sem_destroy,0x0fffff198fffffff,0xfff,globl +.scall sys_sem_destroy,0x0fffff198fffffff,4095,4095,globl diff --git a/libc/sysv/calls/sys_sem_getvalue.S b/libc/sysv/calls/sys_sem_getvalue.S index deef93913..04cb3c591 100644 --- a/libc/sysv/calls/sys_sem_getvalue.S +++ b/libc/sysv/calls/sys_sem_getvalue.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sem_getvalue,0x0fefff197fffffff,0xfff,globl +.scall sys_sem_getvalue,0x0fefff197fffffff,4095,4095,globl diff --git a/libc/sysv/calls/sys_sem_init.S b/libc/sysv/calls/sys_sem_init.S index b7b67b291..f977ae36f 100644 --- a/libc/sysv/calls/sys_sem_init.S +++ b/libc/sysv/calls/sys_sem_init.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sem_init,0x0f7fff194fffffff,0xfff,globl +.scall sys_sem_init,0x0f7fff194fffffff,4095,4095,globl diff --git a/libc/sysv/calls/sys_sem_open.S b/libc/sysv/calls/sys_sem_open.S index c6fcb1875..d04810b10 100644 --- a/libc/sysv/calls/sys_sem_open.S +++ b/libc/sysv/calls/sys_sem_open.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sem_open,0x0f8fff195210cfff,0xfff,globl +.scall sys_sem_open,0x0f8fff195210cfff,4095,268,globl diff --git a/libc/sysv/calls/sys_sem_post.S b/libc/sysv/calls/sys_sem_post.S index 274cc3e2e..ae504abf0 100644 --- a/libc/sysv/calls/sys_sem_post.S +++ b/libc/sysv/calls/sys_sem_post.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sem_post,0x0fbfff1912111fff,0xfff,globl +.scall sys_sem_post,0x0fbfff1912111fff,4095,273,globl diff --git a/libc/sysv/calls/sys_sem_timedwait.S b/libc/sysv/calls/sys_sem_timedwait.S index d63a2696c..1b384404e 100644 --- a/libc/sysv/calls/sys_sem_timedwait.S +++ b/libc/sysv/calls/sys_sem_timedwait.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sem_timedwait,0x900fff9b9fffffff,0xfff,globl +.scall sys_sem_timedwait,0x900fff9b9fffffff,4095,4095,globl diff --git a/libc/sysv/calls/sys_sem_trywait.S b/libc/sysv/calls/sys_sem_trywait.S index 7669979dc..ef4604b75 100644 --- a/libc/sysv/calls/sys_sem_trywait.S +++ b/libc/sysv/calls/sys_sem_trywait.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sem_trywait,0x0fdfff1932110fff,0xfff,globl +.scall sys_sem_trywait,0x0fdfff1932110fff,4095,272,globl diff --git a/libc/sysv/calls/sys_sem_unlink.S b/libc/sysv/calls/sys_sem_unlink.S index a3ced8ade..d9ebddb50 100644 --- a/libc/sysv/calls/sys_sem_unlink.S +++ b/libc/sysv/calls/sys_sem_unlink.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sem_unlink,0x0f9fff196210efff,0xfff,globl +.scall sys_sem_unlink,0x0f9fff196210efff,4095,270,globl diff --git a/libc/sysv/calls/sys_sem_wait.S b/libc/sysv/calls/sys_sem_wait.S index 0fc070af8..da413240f 100644 --- a/libc/sysv/calls/sys_sem_wait.S +++ b/libc/sysv/calls/sys_sem_wait.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sem_wait,0x8fcfff992290ffff,0xfff,globl +.scall sys_sem_wait,0x8fcfff992290ffff,4095,271,globl diff --git a/libc/sysv/calls/sys_sem_wait_nocancel.S b/libc/sysv/calls/sys_sem_wait_nocancel.S index 162c2c96b..8bf0e12d5 100644 --- a/libc/sysv/calls/sys_sem_wait_nocancel.S +++ b/libc/sysv/calls/sys_sem_wait_nocancel.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sem_wait_nocancel,0xfffffffff21a4fff,0xfff,globl +.scall sys_sem_wait_nocancel,0xfffffffff21a4fff,4095,420,globl diff --git a/libc/sysv/calls/sys_semctl.S b/libc/sysv/calls/sys_semctl.S index f7e66b46e..0a306cc3e 100644 --- a/libc/sysv/calls/sys_semctl.S +++ b/libc/sysv/calls/sys_semctl.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_semctl,0xfff1271fe20fe042,0x0bf,globl +.scall sys_semctl,0xfff1271fe20fe042,191,254,globl diff --git a/libc/sysv/calls/sys_semget.S b/libc/sysv/calls/sys_semget.S index ba72cd89c..544acf205 100644 --- a/libc/sysv/calls/sys_semget.S +++ b/libc/sysv/calls/sys_semget.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_semget,0x0dd0dd0dd20ff040,0x0be,globl +.scall sys_semget,0x0dd0dd0dd20ff040,190,255,globl diff --git a/libc/sysv/calls/sys_semop.S b/libc/sysv/calls/sys_semop.S index b82565565..96c10a30c 100644 --- a/libc/sysv/calls/sys_semop.S +++ b/libc/sysv/calls/sys_semop.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_semop,0x0de1220de2100041,0x0c1,globl +.scall sys_semop,0x0de1220de2100041,193,256,globl diff --git a/libc/sysv/calls/sys_semsys.S b/libc/sysv/calls/sys_semsys.S index dc683b157..0a1515d33 100644 --- a/libc/sysv/calls/sys_semsys.S +++ b/libc/sysv/calls/sys_semsys.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_semsys,0xffffff0a920fbfff,0xfff,globl +.scall sys_semsys,0xffffff0a920fbfff,4095,251,globl diff --git a/libc/sysv/calls/sys_semtimedop.S b/libc/sysv/calls/sys_semtimedop.S index 677d1838e..0a5661439 100644 --- a/libc/sysv/calls/sys_semtimedop.S +++ b/libc/sysv/calls/sys_semtimedop.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_semtimedop,0xfffffffffffff0dc,0x0c0,globl +.scall sys_semtimedop,0xfffffffffffff0dc,192,4095,globl diff --git a/libc/sysv/calls/sys_sendfile.S b/libc/sysv/calls/sys_sendfile.S index ef0098d67..ddada0e5c 100644 --- a/libc/sysv/calls/sys_sendfile.S +++ b/libc/sysv/calls/sys_sendfile.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sendfile,0xffffff1892151028,0x047,globl,hidden +.scall sys_sendfile,0xffffff1892151028,71,337,globl,hidden diff --git a/libc/sysv/calls/sys_sendmsg.S b/libc/sysv/calls/sys_sendmsg.S index b4578709f..129044bb4 100644 --- a/libc/sysv/calls/sys_sendmsg.S +++ b/libc/sysv/calls/sys_sendmsg.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sendmsg,0x81c81c81c281c82e,0x0d3,globl,hidden +.scall sys_sendmsg,0x81c81c81c281c82e,211,28,globl,hidden diff --git a/libc/sysv/calls/sys_sendto.S b/libc/sysv/calls/sys_sendto.S index 397417c91..731958593 100644 --- a/libc/sysv/calls/sys_sendto.S +++ b/libc/sysv/calls/sys_sendto.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sendto,0x885885885288582c,0x0ce,globl,hidden +.scall sys_sendto,0x885885885288582c,206,133,globl,hidden diff --git a/libc/sysv/calls/sys_set_mempolicy_home_node.S b/libc/sysv/calls/sys_set_mempolicy_home_node.S index 61d9accb9..dd0764e20 100644 --- a/libc/sysv/calls/sys_set_mempolicy_home_node.S +++ b/libc/sysv/calls/sys_set_mempolicy_home_node.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_set_mempolicy_home_node,0xfffffffffffff1c2,0xfff,globl +.scall sys_set_mempolicy_home_node,0xfffffffffffff1c2,4095,4095,globl diff --git a/libc/sysv/calls/sys_set_robust_list.S b/libc/sysv/calls/sys_set_robust_list.S index 22185ba79..8a6b03ed7 100644 --- a/libc/sysv/calls/sys_set_robust_list.S +++ b/libc/sysv/calls/sys_set_robust_list.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_set_robust_list,0x0a7ffffffffff111,0x063,globl +.scall sys_set_robust_list,0x0a7ffffffffff111,99,4095,globl diff --git a/libc/sysv/calls/sys_set_tid_address.S b/libc/sysv/calls/sys_set_tid_address.S index 99f983d74..4fc8f6444 100644 --- a/libc/sysv/calls/sys_set_tid_address.S +++ b/libc/sysv/calls/sys_set_tid_address.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_set_tid_address,0xfffffffffffff0da,0x060,globl +.scall sys_set_tid_address,0xfffffffffffff0da,96,4095,globl diff --git a/libc/sysv/calls/sys_set_tls.S b/libc/sysv/calls/sys_set_tls.S index 34279f450..5a715cafd 100644 --- a/libc/sysv/calls/sys_set_tls.S +++ b/libc/sysv/calls/sys_set_tls.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_set_tls,0x13d1490a5300309e,0xfff,globl,hidden +.scall sys_set_tls,0x13d1490a5300309e,4095,3,globl,hidden diff --git a/libc/sysv/calls/sys_setaudit_addr.S b/libc/sysv/calls/sys_setaudit_addr.S index c90fe8823..108342e08 100644 --- a/libc/sysv/calls/sys_setaudit_addr.S +++ b/libc/sysv/calls/sys_setaudit_addr.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_setaudit_addr,0xffffff1c42166fff,0xfff,globl +.scall sys_setaudit_addr,0xffffff1c42166fff,4095,358,globl diff --git a/libc/sysv/calls/sys_setauid.S b/libc/sysv/calls/sys_setauid.S index 851833155..638130920 100644 --- a/libc/sysv/calls/sys_setauid.S +++ b/libc/sysv/calls/sys_setauid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_setauid,0xffffff1c02162fff,0xfff,globl +.scall sys_setauid,0xffffff1c02162fff,4095,354,globl diff --git a/libc/sysv/calls/sys_setdomainname.S b/libc/sysv/calls/sys_setdomainname.S index 2cc432704..0cdd2f581 100644 --- a/libc/sysv/calls/sys_setdomainname.S +++ b/libc/sysv/calls/sys_setdomainname.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_setdomainname,0xffffff0a3ffff0ab,0x0a2,globl +.scall sys_setdomainname,0xffffff0a3ffff0ab,162,4095,globl diff --git a/libc/sysv/calls/sys_setfsgid.S b/libc/sysv/calls/sys_setfsgid.S index 73dca7090..34a39fdd2 100644 --- a/libc/sysv/calls/sys_setfsgid.S +++ b/libc/sysv/calls/sys_setfsgid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_setfsgid,0xfffffffffffff07b,0x098,globl,hidden +.scall sys_setfsgid,0xfffffffffffff07b,152,4095,globl,hidden diff --git a/libc/sysv/calls/sys_setfsuid.S b/libc/sysv/calls/sys_setfsuid.S index 0168c6138..fdb3f8a16 100644 --- a/libc/sysv/calls/sys_setfsuid.S +++ b/libc/sysv/calls/sys_setfsuid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_setfsuid,0xfffffffffffff07a,0x097,globl,hidden +.scall sys_setfsuid,0xfffffffffffff07a,151,4095,globl,hidden diff --git a/libc/sysv/calls/sys_setgid.S b/libc/sysv/calls/sys_setgid.S index b184bec48..75c801766 100644 --- a/libc/sysv/calls/sys_setgid.S +++ b/libc/sysv/calls/sys_setgid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_setgid,0x0b50b50b520b506a,0x090,globl,hidden +.scall sys_setgid,0x0b50b50b520b506a,144,181,globl,hidden diff --git a/libc/sysv/calls/sys_setgroups.S b/libc/sysv/calls/sys_setgroups.S index be44d71ba..ca4d68088 100644 --- a/libc/sysv/calls/sys_setgroups.S +++ b/libc/sysv/calls/sys_setgroups.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_setgroups,0x0500500502050074,0x09f,globl,hidden +.scall sys_setgroups,0x0500500502050074,159,80,globl,hidden diff --git a/libc/sysv/calls/sys_sethostname.S b/libc/sysv/calls/sys_sethostname.S index aead5b1b7..06b22bc5b 100644 --- a/libc/sysv/calls/sys_sethostname.S +++ b/libc/sysv/calls/sys_sethostname.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sethostname,0xffffff058ffff0aa,0x0a1,globl +.scall sys_sethostname,0xffffff058ffff0aa,161,4095,globl diff --git a/libc/sysv/calls/sys_setitimer.S b/libc/sysv/calls/sys_setitimer.S index 785aa9e61..db78b1377 100644 --- a/libc/sysv/calls/sys_setitimer.S +++ b/libc/sysv/calls/sys_setitimer.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_setitimer,0x1a90450532053026,0x067,globl,hidden +.scall sys_setitimer,0x1a90450532053026,103,83,globl,hidden diff --git a/libc/sysv/calls/sys_setlogin.S b/libc/sysv/calls/sys_setlogin.S index 0b4945434..d53d1e9fb 100644 --- a/libc/sysv/calls/sys_setlogin.S +++ b/libc/sysv/calls/sys_setlogin.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_setlogin,0xfff0320322032fff,0xfff,globl +.scall sys_setlogin,0xfff0320322032fff,4095,50,globl diff --git a/libc/sysv/calls/sys_setns.S b/libc/sysv/calls/sys_setns.S index 1468ef888..800e2d5bf 100644 --- a/libc/sysv/calls/sys_setns.S +++ b/libc/sysv/calls/sys_setns.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_setns,0xfffffffffffff134,0x10c,globl +.scall sys_setns,0xfffffffffffff134,268,4095,globl diff --git a/libc/sysv/calls/sys_setpgid.S b/libc/sysv/calls/sys_setpgid.S index 9ab6ee3a3..e64df3d5d 100644 --- a/libc/sysv/calls/sys_setpgid.S +++ b/libc/sysv/calls/sys_setpgid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_setpgid,0x052052052205206d,0x09a,globl,hidden +.scall sys_setpgid,0x052052052205206d,154,82,globl,hidden diff --git a/libc/sysv/calls/sys_setpriority.S b/libc/sysv/calls/sys_setpriority.S index cf38c8a98..bc34ccd93 100644 --- a/libc/sysv/calls/sys_setpriority.S +++ b/libc/sysv/calls/sys_setpriority.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_setpriority,0x060060060206008d,0x08c,globl,hidden +.scall sys_setpriority,0x060060060206008d,140,96,globl,hidden diff --git a/libc/sysv/calls/sys_setregid.S b/libc/sysv/calls/sys_setregid.S index b4cdbc04d..5c60b1d0e 100644 --- a/libc/sysv/calls/sys_setregid.S +++ b/libc/sysv/calls/sys_setregid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_setregid,0x07f07f07f207f072,0x08f,globl,hidden +.scall sys_setregid,0x07f07f07f207f072,143,127,globl,hidden diff --git a/libc/sysv/calls/sys_setresgid.S b/libc/sysv/calls/sys_setresgid.S index c516e9803..9e46474f7 100644 --- a/libc/sysv/calls/sys_setresgid.S +++ b/libc/sysv/calls/sys_setresgid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_setresgid,0xfff11c138ffff077,0x095,globl,hidden +.scall sys_setresgid,0xfff11c138ffff077,149,4095,globl,hidden diff --git a/libc/sysv/calls/sys_setresuid.S b/libc/sysv/calls/sys_setresuid.S index d4f76f48a..05ea0ff6f 100644 --- a/libc/sysv/calls/sys_setresuid.S +++ b/libc/sysv/calls/sys_setresuid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_setresuid,0xfff11a137ffff075,0x093,globl,hidden +.scall sys_setresuid,0xfff11a137ffff075,147,4095,globl,hidden diff --git a/libc/sysv/calls/sys_setreuid.S b/libc/sysv/calls/sys_setreuid.S index 62e72807f..d73b3316b 100644 --- a/libc/sysv/calls/sys_setreuid.S +++ b/libc/sysv/calls/sys_setreuid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_setreuid,0x07e07e07e207e071,0x091,globl,hidden +.scall sys_setreuid,0x07e07e07e207e071,145,126,globl,hidden diff --git a/libc/sysv/calls/sys_setrlimit.S b/libc/sysv/calls/sys_setrlimit.S index a24a02e2a..75b921405 100644 --- a/libc/sysv/calls/sys_setrlimit.S +++ b/libc/sysv/calls/sys_setrlimit.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_setrlimit,0x0c30c30c320c30a0,0x0a4,globl,hidden +.scall sys_setrlimit,0x0c30c30c320c30a0,164,195,globl,hidden diff --git a/libc/sysv/calls/sys_setsid.S b/libc/sysv/calls/sys_setsid.S index c1c898aec..2ad99e25a 100644 --- a/libc/sysv/calls/sys_setsid.S +++ b/libc/sysv/calls/sys_setsid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_setsid,0x0930930932093070,0x09d,globl,hidden +.scall sys_setsid,0x0930930932093070,157,147,globl,hidden diff --git a/libc/sysv/calls/sys_setsockopt.S b/libc/sysv/calls/sys_setsockopt.S index 4675ae845..a2d994e0c 100644 --- a/libc/sysv/calls/sys_setsockopt.S +++ b/libc/sysv/calls/sys_setsockopt.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_setsockopt,0x0690690692069036,0x0d0,globl,hidden +.scall sys_setsockopt,0x0690690692069036,208,105,globl,hidden diff --git a/libc/sysv/calls/sys_settimeofday.S b/libc/sysv/calls/sys_settimeofday.S index 5c8149b74..c02d20397 100644 --- a/libc/sysv/calls/sys_settimeofday.S +++ b/libc/sysv/calls/sys_settimeofday.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_settimeofday,0x1a304407a207a0a4,0x0aa,globl +.scall sys_settimeofday,0x1a304407a207a0a4,170,122,globl diff --git a/libc/sysv/calls/sys_setuid.S b/libc/sysv/calls/sys_setuid.S index 1d348f64a..da47b15c7 100644 --- a/libc/sysv/calls/sys_setuid.S +++ b/libc/sysv/calls/sys_setuid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_setuid,0x0170170172017069,0x092,globl,hidden +.scall sys_setuid,0x0170170172017069,146,23,globl,hidden diff --git a/libc/sysv/calls/sys_setxattr.S b/libc/sysv/calls/sys_setxattr.S index ac6a6c83d..15c74f085 100644 --- a/libc/sysv/calls/sys_setxattr.S +++ b/libc/sysv/calls/sys_setxattr.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_setxattr,0x177ffffff20ec0bc,0x005,globl +.scall sys_setxattr,0x177ffffff20ec0bc,5,236,globl diff --git a/libc/sysv/calls/sys_shm_open.S b/libc/sysv/calls/sys_shm_open.S index c5cfdafa0..e49a0885f 100644 --- a/libc/sysv/calls/sys_shm_open.S +++ b/libc/sysv/calls/sys_shm_open.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_shm_open,0xffffff1e2210afff,0xfff,globl +.scall sys_shm_open,0xffffff1e2210afff,4095,266,globl diff --git a/libc/sysv/calls/sys_shm_unlink.S b/libc/sysv/calls/sys_shm_unlink.S index b5fdfbfec..afdab3608 100644 --- a/libc/sysv/calls/sys_shm_unlink.S +++ b/libc/sysv/calls/sys_shm_unlink.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_shm_unlink,0xffffff1e3210bfff,0xfff,globl +.scall sys_shm_unlink,0xffffff1e3210bfff,4095,267,globl diff --git a/libc/sysv/calls/sys_shmat.S b/libc/sysv/calls/sys_shmat.S index 0bfbd2e79..6f41abc88 100644 --- a/libc/sysv/calls/sys_shmat.S +++ b/libc/sysv/calls/sys_shmat.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_shmat,0x0e40e40e4210601e,0x0c4,globl +.scall sys_shmat,0x0e40e40e4210601e,196,262,globl diff --git a/libc/sysv/calls/sys_shmctl.S b/libc/sysv/calls/sys_shmctl.S index 2266f0869..b8f3ebb1f 100644 --- a/libc/sysv/calls/sys_shmctl.S +++ b/libc/sysv/calls/sys_shmctl.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_shmctl,0x1bb128200210701f,0x0c3,globl +.scall sys_shmctl,0x1bb128200210701f,195,263,globl diff --git a/libc/sysv/calls/sys_shmdt.S b/libc/sysv/calls/sys_shmdt.S index 1d2a4477e..d09cca5ce 100644 --- a/libc/sysv/calls/sys_shmdt.S +++ b/libc/sysv/calls/sys_shmdt.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_shmdt,0x0e60e60e62108043,0x0c5,globl +.scall sys_shmdt,0x0e60e60e62108043,197,264,globl diff --git a/libc/sysv/calls/sys_shmget.S b/libc/sysv/calls/sys_shmget.S index 5f359a27e..fc21d1662 100644 --- a/libc/sysv/calls/sys_shmget.S +++ b/libc/sysv/calls/sys_shmget.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_shmget,0x0e71210e7210901d,0x0c2,globl +.scall sys_shmget,0x0e71210e7210901d,194,265,globl diff --git a/libc/sysv/calls/sys_shmsys.S b/libc/sysv/calls/sys_shmsys.S index 964060c05..69ae2a91b 100644 --- a/libc/sysv/calls/sys_shmsys.S +++ b/libc/sysv/calls/sys_shmsys.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_shmsys,0xffffff0ab20fdfff,0xfff,globl +.scall sys_shmsys,0xffffff0ab20fdfff,4095,253,globl diff --git a/libc/sysv/calls/sys_shutdown.S b/libc/sysv/calls/sys_shutdown.S index 355a1b9a6..39855efb3 100644 --- a/libc/sysv/calls/sys_shutdown.S +++ b/libc/sysv/calls/sys_shutdown.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_shutdown,0x0860860862086030,0x0d2,globl,hidden +.scall sys_shutdown,0x0860860862086030,210,134,globl,hidden diff --git a/libc/sysv/calls/sys_sigaction.S b/libc/sysv/calls/sys_sigaction.S index 9f5adc56b..24d40f65b 100644 --- a/libc/sysv/calls/sys_sigaction.S +++ b/libc/sysv/calls/sys_sigaction.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sigaction,0x15402e1a0202e00d,0x086,globl,hidden +.scall sys_sigaction,0x15402e1a0202e00d,134,46,globl,hidden diff --git a/libc/sysv/calls/sys_sigaltstack.S b/libc/sysv/calls/sys_sigaltstack.S index 2132923c3..0a4efa830 100644 --- a/libc/sysv/calls/sys_sigaltstack.S +++ b/libc/sysv/calls/sys_sigaltstack.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sigaltstack,0x1191200352035083,0x084,globl,hidden +.scall sys_sigaltstack,0x1191200352035083,132,53,globl,hidden diff --git a/libc/sysv/calls/sys_signalfd.S b/libc/sysv/calls/sys_signalfd.S index 7f7ddc15b..1d5e58d2a 100644 --- a/libc/sysv/calls/sys_signalfd.S +++ b/libc/sysv/calls/sys_signalfd.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_signalfd,0xfffffffffffff11a,0xfff,globl +.scall sys_signalfd,0xfffffffffffff11a,4095,4095,globl diff --git a/libc/sysv/calls/sys_signalfd4.S b/libc/sysv/calls/sys_signalfd4.S index 62f0843bb..81e684366 100644 --- a/libc/sysv/calls/sys_signalfd4.S +++ b/libc/sysv/calls/sys_signalfd4.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_signalfd4,0xfffffffffffff121,0x04a,globl +.scall sys_signalfd4,0xfffffffffffff121,74,4095,globl diff --git a/libc/sysv/calls/sys_sigpending.S b/libc/sysv/calls/sys_sigpending.S index 07b31bbc3..b965fa67e 100644 --- a/libc/sysv/calls/sys_sigpending.S +++ b/libc/sysv/calls/sys_sigpending.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sigpending,0x124034157203407f,0x088,globl,hidden +.scall sys_sigpending,0x124034157203407f,136,52,globl,hidden diff --git a/libc/sysv/calls/sys_sigqueue.S b/libc/sysv/calls/sys_sigqueue.S index a1874343c..5f1f56f75 100644 --- a/libc/sysv/calls/sys_sigqueue.S +++ b/libc/sysv/calls/sys_sigqueue.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sigqueue,0xffffff1c8fffffff,0xfff,globl,hidden +.scall sys_sigqueue,0xffffff1c8fffffff,4095,4095,globl,hidden diff --git a/libc/sysv/calls/sys_sigqueueinfo.S b/libc/sysv/calls/sys_sigqueueinfo.S index 7fea33a6e..5d8df3d9f 100644 --- a/libc/sysv/calls/sys_sigqueueinfo.S +++ b/libc/sysv/calls/sys_sigqueueinfo.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sigqueueinfo,0x0f5ffffffffff081,0x08a,globl,hidden +.scall sys_sigqueueinfo,0x0f5ffffffffff081,138,4095,globl,hidden diff --git a/libc/sysv/calls/sys_sigsuspend.S b/libc/sysv/calls/sys_sigsuspend.S index 072373df0..6e9e59834 100644 --- a/libc/sysv/calls/sys_sigsuspend.S +++ b/libc/sysv/calls/sys_sigsuspend.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sigsuspend,0x92686f955286f882,0x085,globl,hidden +.scall sys_sigsuspend,0x92686f955286f882,133,111,globl,hidden diff --git a/libc/sysv/calls/sys_sigtimedwait.S b/libc/sysv/calls/sys_sigtimedwait.S index 6f40fb5e9..481b92ca2 100644 --- a/libc/sysv/calls/sys_sigtimedwait.S +++ b/libc/sysv/calls/sys_sigtimedwait.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sigtimedwait,0x9affff959ffff880,0x089,globl,hidden +.scall sys_sigtimedwait,0x9affff959ffff880,137,4095,globl,hidden diff --git a/libc/sysv/calls/sys_sigwait.S b/libc/sysv/calls/sys_sigwait.S index b34e0dd6d..bc46c487f 100644 --- a/libc/sysv/calls/sys_sigwait.S +++ b/libc/sysv/calls/sys_sigwait.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sigwait,0xffffff1ad214afff,0xfff,globl +.scall sys_sigwait,0xffffff1ad214afff,4095,330,globl diff --git a/libc/sysv/calls/sys_splice.S b/libc/sysv/calls/sys_splice.S index 066ff1531..1f079e315 100644 --- a/libc/sysv/calls/sys_splice.S +++ b/libc/sysv/calls/sys_splice.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_splice,0xfffffffffffff113,0x04c,globl,hidden +.scall sys_splice,0xfffffffffffff113,76,4095,globl,hidden diff --git a/libc/sysv/calls/sys_statfs.S b/libc/sysv/calls/sys_statfs.S index bb11530bb..871a0b25a 100644 --- a/libc/sysv/calls/sys_statfs.S +++ b/libc/sysv/calls/sys_statfs.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_statfs,0x89d83fa2b2959889,0x02b,globl,hidden +.scall sys_statfs,0x89d83fa2b2959889,43,345,globl,hidden diff --git a/libc/sysv/calls/sys_statx.S b/libc/sysv/calls/sys_statx.S index 6b260042e..03ec62bd7 100644 --- a/libc/sysv/calls/sys_statx.S +++ b/libc/sysv/calls/sys_statx.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_statx,0xfffffffffffff14c,0x123,globl +.scall sys_statx,0xfffffffffffff14c,291,4095,globl diff --git a/libc/sysv/calls/sys_swapoff.S b/libc/sysv/calls/sys_swapoff.S index b75beccb9..64a8b5147 100644 --- a/libc/sysv/calls/sys_swapoff.S +++ b/libc/sysv/calls/sys_swapoff.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_swapoff,0xffffff1a8ffff0a8,0x0e1,globl +.scall sys_swapoff,0xffffff1a8ffff0a8,225,4095,globl diff --git a/libc/sysv/calls/sys_swapon.S b/libc/sysv/calls/sys_swapon.S index f01ba7ed1..9354054b1 100644 --- a/libc/sysv/calls/sys_swapon.S +++ b/libc/sysv/calls/sys_swapon.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_swapon,0xffffff05520550a7,0x0e0,globl +.scall sys_swapon,0xffffff05520550a7,224,85,globl diff --git a/libc/sysv/calls/sys_symlinkat.S b/libc/sysv/calls/sys_symlinkat.S index 4ac189a6b..6c24d0791 100644 --- a/libc/sysv/calls/sys_symlinkat.S +++ b/libc/sysv/calls/sys_symlinkat.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_symlinkat,0x1d61441f621da10a,0x024,globl,hidden +.scall sys_symlinkat,0x1d61441f621da10a,36,474,globl,hidden diff --git a/libc/sysv/calls/sys_sync.S b/libc/sysv/calls/sys_sync.S index 8c4a05094..9161eb6f2 100644 --- a/libc/sysv/calls/sys_sync.S +++ b/libc/sysv/calls/sys_sync.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sync,0x02402402420240a2,0x051,globl,hidden +.scall sys_sync,0x02402402420240a2,81,36,globl,hidden diff --git a/libc/sysv/calls/sys_sync_file_range.S b/libc/sysv/calls/sys_sync_file_range.S index db8abad48..f3781974e 100644 --- a/libc/sysv/calls/sys_sync_file_range.S +++ b/libc/sysv/calls/sys_sync_file_range.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sync_file_range,0xfffffffffffff115,0x054,globl,hidden +.scall sys_sync_file_range,0xfffffffffffff115,84,4095,globl,hidden diff --git a/libc/sysv/calls/sys_syncfs.S b/libc/sysv/calls/sys_syncfs.S index 8d9493bbe..24328aae7 100644 --- a/libc/sysv/calls/sys_syncfs.S +++ b/libc/sysv/calls/sys_syncfs.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_syncfs,0xfffffffffffff132,0x10b,globl +.scall sys_syncfs,0xfffffffffffff132,267,4095,globl diff --git a/libc/sysv/calls/sys_sysctl.S b/libc/sysv/calls/sys_sysctl.S index a83406750..684aca818 100644 --- a/libc/sysv/calls/sys_sysctl.S +++ b/libc/sysv/calls/sys_sysctl.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sysctl,0x0ca0ca0ca20cafff,0xfff,globl +.scall sys_sysctl,0x0ca0ca0ca20cafff,4095,202,globl diff --git a/libc/sysv/calls/sys_sysfs.S b/libc/sysv/calls/sys_sysfs.S index 71049323a..08968cce3 100644 --- a/libc/sysv/calls/sys_sysfs.S +++ b/libc/sysv/calls/sys_sysfs.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sysfs,0xfffffffffffff08b,0xfff,globl +.scall sys_sysfs,0xfffffffffffff08b,4095,4095,globl diff --git a/libc/sysv/calls/sys_sysinfo.S b/libc/sysv/calls/sys_sysinfo.S index 2aaac57bb..c00e9a7c0 100644 --- a/libc/sysv/calls/sys_sysinfo.S +++ b/libc/sysv/calls/sys_sysinfo.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_sysinfo,0xfffffffffffff063,0x0b3,globl,hidden +.scall sys_sysinfo,0xfffffffffffff063,179,4095,globl,hidden diff --git a/libc/sysv/calls/sys_syslog.S b/libc/sysv/calls/sys_syslog.S index b8baee3d9..a4a8a77d1 100644 --- a/libc/sysv/calls/sys_syslog.S +++ b/libc/sysv/calls/sys_syslog.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_syslog,0xfffffffffffff067,0x074,globl,hidden +.scall sys_syslog,0xfffffffffffff067,116,4095,globl,hidden diff --git a/libc/sysv/calls/sys_tee.S b/libc/sysv/calls/sys_tee.S index 10729933f..8bf8f5156 100644 --- a/libc/sysv/calls/sys_tee.S +++ b/libc/sysv/calls/sys_tee.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_tee,0xfffffffffffff114,0x04d,globl +.scall sys_tee,0xfffffffffffff114,77,4095,globl diff --git a/libc/sysv/calls/sys_tgkill.S b/libc/sysv/calls/sys_tgkill.S index 0adedfde5..a5488612b 100644 --- a/libc/sysv/calls/sys_tgkill.S +++ b/libc/sysv/calls/sys_tgkill.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_tgkill,0xffffff1e1ffff0ea,0x083,globl,hidden +.scall sys_tgkill,0xffffff1e1ffff0ea,131,4095,globl,hidden diff --git a/libc/sysv/calls/sys_tgsigqueueinfo.S b/libc/sysv/calls/sys_tgsigqueueinfo.S index 7b0c56843..114913bae 100644 --- a/libc/sysv/calls/sys_tgsigqueueinfo.S +++ b/libc/sysv/calls/sys_tgsigqueueinfo.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_tgsigqueueinfo,0xfffffffffffff129,0x0f0,globl +.scall sys_tgsigqueueinfo,0xfffffffffffff129,240,4095,globl diff --git a/libc/sysv/calls/sys_timer_create.S b/libc/sysv/calls/sys_timer_create.S index 87643f801..0ce2ee3ff 100644 --- a/libc/sysv/calls/sys_timer_create.S +++ b/libc/sysv/calls/sys_timer_create.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_timer_create,0x0ebffffffffff0de,0x06b,globl +.scall sys_timer_create,0x0ebffffffffff0de,107,4095,globl diff --git a/libc/sysv/calls/sys_timer_delete.S b/libc/sysv/calls/sys_timer_delete.S index bc1e0e55a..1c8f9a448 100644 --- a/libc/sysv/calls/sys_timer_delete.S +++ b/libc/sysv/calls/sys_timer_delete.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_timer_delete,0x0ecffffffffff0e2,0x06f,globl +.scall sys_timer_delete,0x0ecffffffffff0e2,111,4095,globl diff --git a/libc/sysv/calls/sys_timer_getoverrun.S b/libc/sysv/calls/sys_timer_getoverrun.S index d23800018..a9e2b0e30 100644 --- a/libc/sysv/calls/sys_timer_getoverrun.S +++ b/libc/sysv/calls/sys_timer_getoverrun.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_timer_getoverrun,0x0efffffffffff0e1,0x06d,globl +.scall sys_timer_getoverrun,0x0efffffffffff0e1,109,4095,globl diff --git a/libc/sysv/calls/sys_timer_gettime.S b/libc/sysv/calls/sys_timer_gettime.S index e56818a11..8d570375e 100644 --- a/libc/sysv/calls/sys_timer_gettime.S +++ b/libc/sysv/calls/sys_timer_gettime.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_timer_gettime,0x1bfffffffffff0e0,0x06c,globl +.scall sys_timer_gettime,0x1bfffffffffff0e0,108,4095,globl diff --git a/libc/sysv/calls/sys_timer_settime.S b/libc/sysv/calls/sys_timer_settime.S index 4e5aa9672..b28daa523 100644 --- a/libc/sysv/calls/sys_timer_settime.S +++ b/libc/sysv/calls/sys_timer_settime.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_timer_settime,0x1beffffffffff0df,0x06e,globl +.scall sys_timer_settime,0x1beffffffffff0df,110,4095,globl diff --git a/libc/sysv/calls/sys_timerfd_create.S b/libc/sysv/calls/sys_timerfd_create.S index db7d921e9..b8aa393d7 100644 --- a/libc/sysv/calls/sys_timerfd_create.S +++ b/libc/sysv/calls/sys_timerfd_create.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_timerfd_create,0xfffffffffffff11b,0x055,globl +.scall sys_timerfd_create,0xfffffffffffff11b,85,4095,globl diff --git a/libc/sysv/calls/sys_timerfd_gettime.S b/libc/sysv/calls/sys_timerfd_gettime.S index 24b7c72e0..213f735c4 100644 --- a/libc/sysv/calls/sys_timerfd_gettime.S +++ b/libc/sysv/calls/sys_timerfd_gettime.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_timerfd_gettime,0xfffffffffffff11f,0x057,globl +.scall sys_timerfd_gettime,0xfffffffffffff11f,87,4095,globl diff --git a/libc/sysv/calls/sys_timerfd_settime.S b/libc/sysv/calls/sys_timerfd_settime.S index 3d26c0ca0..dc80e278d 100644 --- a/libc/sysv/calls/sys_timerfd_settime.S +++ b/libc/sysv/calls/sys_timerfd_settime.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_timerfd_settime,0xfffffffffffff11e,0x056,globl +.scall sys_timerfd_settime,0xfffffffffffff11e,86,4095,globl diff --git a/libc/sysv/calls/sys_times.S b/libc/sysv/calls/sys_times.S index 05ba0972f..207b93d89 100644 --- a/libc/sysv/calls/sys_times.S +++ b/libc/sysv/calls/sys_times.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_times,0xfffffffffffff064,0x099,globl,hidden +.scall sys_times,0xfffffffffffff064,153,4095,globl,hidden diff --git a/libc/sysv/calls/sys_tkill.S b/libc/sysv/calls/sys_tkill.S index d9bef6987..e3b4b2037 100644 --- a/libc/sysv/calls/sys_tkill.S +++ b/libc/sysv/calls/sys_tkill.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_tkill,0x13e0771b121480c8,0x082,globl,hidden +.scall sys_tkill,0x13e0771b121480c8,130,328,globl,hidden diff --git a/libc/sysv/calls/sys_truncate.S b/libc/sysv/calls/sys_truncate.S index a53ea6906..e75465ae2 100644 --- a/libc/sysv/calls/sys_truncate.S +++ b/libc/sysv/calls/sys_truncate.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_truncate,0x8c88c89df28c884c,0x02d,globl,hidden +.scall sys_truncate,0x8c88c89df28c884c,45,200,globl,hidden diff --git a/libc/sysv/calls/sys_umask.S b/libc/sysv/calls/sys_umask.S index a48cb80fd..80677e45b 100644 --- a/libc/sysv/calls/sys_umask.S +++ b/libc/sysv/calls/sys_umask.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_umask,0x03c03c03c203c05f,0x0a6,globl,hidden +.scall sys_umask,0x03c03c03c203c05f,166,60,globl,hidden diff --git a/libc/sysv/calls/sys_umount2.S b/libc/sysv/calls/sys_umount2.S index 6d1c91311..4e4111bee 100644 --- a/libc/sysv/calls/sys_umount2.S +++ b/libc/sysv/calls/sys_umount2.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_umount2,0x016016016209f0a6,0x027,globl +.scall sys_umount2,0x016016016209f0a6,39,159,globl diff --git a/libc/sysv/calls/sys_uname.S b/libc/sysv/calls/sys_uname.S index 92b8f0f17..a6a598337 100644 --- a/libc/sysv/calls/sys_uname.S +++ b/libc/sysv/calls/sys_uname.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_uname,0x0a4fff0a4ffff03f,0x0a0,globl,hidden +.scall sys_uname,0x0a4fff0a4ffff03f,160,4095,globl,hidden diff --git a/libc/sysv/calls/sys_undelete.S b/libc/sysv/calls/sys_undelete.S index cc948e021..d590b5fe1 100644 --- a/libc/sysv/calls/sys_undelete.S +++ b/libc/sysv/calls/sys_undelete.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_undelete,0x0cdfff0cd20cdfff,0xfff,globl +.scall sys_undelete,0x0cdfff0cd20cdfff,4095,205,globl diff --git a/libc/sysv/calls/sys_unlink.S b/libc/sysv/calls/sys_unlink.S index 8161ff1a8..3066efc30 100644 --- a/libc/sysv/calls/sys_unlink.S +++ b/libc/sysv/calls/sys_unlink.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_unlink,0x00a00a00a200a057,0x0b5,globl,hidden +.scall sys_unlink,0x00a00a00a200a057,181,10,globl,hidden diff --git a/libc/sysv/calls/sys_unlinkat.S b/libc/sysv/calls/sys_unlinkat.S index 1ecb0fbd4..dd373568e 100644 --- a/libc/sysv/calls/sys_unlinkat.S +++ b/libc/sysv/calls/sys_unlinkat.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_unlinkat,0x1d71451f721d8107,0x023,globl,hidden +.scall sys_unlinkat,0x1d71451f721d8107,35,472,globl,hidden diff --git a/libc/sysv/calls/sys_unmount.S b/libc/sysv/calls/sys_unmount.S index 1c1844dc9..17d2567d9 100644 --- a/libc/sysv/calls/sys_unmount.S +++ b/libc/sysv/calls/sys_unmount.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_unmount,0x016016016209f0a6,0xfff,globl +.scall sys_unmount,0x016016016209f0a6,4095,159,globl diff --git a/libc/sysv/calls/sys_unshare.S b/libc/sysv/calls/sys_unshare.S index 25a182b42..6dc9f9822 100644 --- a/libc/sysv/calls/sys_unshare.S +++ b/libc/sysv/calls/sys_unshare.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_unshare,0xfffffffffffff110,0x061,globl +.scall sys_unshare,0xfffffffffffff110,97,4095,globl diff --git a/libc/sysv/calls/sys_unveil.S b/libc/sysv/calls/sys_unveil.S index ff8736529..f7dcb0844 100644 --- a/libc/sysv/calls/sys_unveil.S +++ b/libc/sysv/calls/sys_unveil.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_unveil,0xfff072ffffffffff,0xfff,globl,hidden +.scall sys_unveil,0xfff072ffffffffff,4095,4095,globl,hidden diff --git a/libc/sysv/calls/sys_userfaultfd.S b/libc/sysv/calls/sys_userfaultfd.S index e96bf7ca8..29bc9a182 100644 --- a/libc/sysv/calls/sys_userfaultfd.S +++ b/libc/sysv/calls/sys_userfaultfd.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_userfaultfd,0xfffffffffffff143,0x11a,globl +.scall sys_userfaultfd,0xfffffffffffff143,282,4095,globl diff --git a/libc/sysv/calls/sys_ustat.S b/libc/sysv/calls/sys_ustat.S index 0cc1d0481..e44117068 100644 --- a/libc/sysv/calls/sys_ustat.S +++ b/libc/sysv/calls/sys_ustat.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_ustat,0xfffffffffffff088,0xfff,globl +.scall sys_ustat,0xfffffffffffff088,4095,4095,globl diff --git a/libc/sysv/calls/sys_utime.S b/libc/sysv/calls/sys_utime.S index 4ccd6ecc7..29b32c000 100644 --- a/libc/sysv/calls/sys_utime.S +++ b/libc/sysv/calls/sys_utime.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_utime,0xfffffffffffff084,0x062,globl,hidden +.scall sys_utime,0xfffffffffffff084,98,4095,globl,hidden diff --git a/libc/sysv/calls/sys_utimes.S b/libc/sysv/calls/sys_utimes.S index c1754c339..d59ceb8d1 100644 --- a/libc/sysv/calls/sys_utimes.S +++ b/libc/sysv/calls/sys_utimes.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_utimes,0x1a404c08a208a0eb,0x058,globl,hidden +.scall sys_utimes,0x1a404c08a208a0eb,88,138,globl,hidden diff --git a/libc/sysv/calls/sys_utrace.S b/libc/sysv/calls/sys_utrace.S index e0be17884..c99dc21f6 100644 --- a/libc/sysv/calls/sys_utrace.S +++ b/libc/sysv/calls/sys_utrace.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_utrace,0x1320d114ffffffff,0xfff,globl +.scall sys_utrace,0x1320d114ffffffff,4095,4095,globl diff --git a/libc/sysv/calls/sys_vhangup.S b/libc/sysv/calls/sys_vhangup.S index ea5bfab24..f48e45a6c 100644 --- a/libc/sysv/calls/sys_vhangup.S +++ b/libc/sysv/calls/sys_vhangup.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_vhangup,0xfffffffffffff099,0x03a,globl +.scall sys_vhangup,0xfffffffffffff099,58,4095,globl diff --git a/libc/sysv/calls/sys_vmsplice.S b/libc/sysv/calls/sys_vmsplice.S index acc7d4099..08f2bc79f 100644 --- a/libc/sysv/calls/sys_vmsplice.S +++ b/libc/sysv/calls/sys_vmsplice.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_vmsplice,0xfffffffffffff116,0x04b,globl,hidden +.scall sys_vmsplice,0xfffffffffffff116,75,4095,globl,hidden diff --git a/libc/sysv/calls/sys_waitid.S b/libc/sysv/calls/sys_waitid.S index 598dbb34e..83a65b23e 100644 --- a/libc/sysv/calls/sys_waitid.S +++ b/libc/sysv/calls/sys_waitid.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_waitid,0xfffffffff28ad8f7,0x05f,globl +.scall sys_waitid,0xfffffffff28ad8f7,95,173,globl diff --git a/libc/sysv/calls/sys_write.S b/libc/sysv/calls/sys_write.S index 5e8f16b53..41eec3036 100644 --- a/libc/sysv/calls/sys_write.S +++ b/libc/sysv/calls/sys_write.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_write,0x8048048042804801,0x040,globl,hidden +.scall sys_write,0x8048048042804801,64,4,globl,hidden diff --git a/libc/sysv/calls/sys_writev.S b/libc/sysv/calls/sys_writev.S index 1cdc7e4fc..8ec662b3c 100644 --- a/libc/sysv/calls/sys_writev.S +++ b/libc/sysv/calls/sys_writev.S @@ -1,2 +1,2 @@ #include "libc/sysv/macros.internal.h" -.scall sys_writev,0x8798798792879814,0x042,globl,hidden +.scall sys_writev,0x8798798792879814,66,121,globl,hidden diff --git a/libc/sysv/consts.sh b/libc/sysv/consts.sh index bc78e0df6..981e56659 100755 --- a/libc/sysv/consts.sh +++ b/libc/sysv/consts.sh @@ -435,29 +435,29 @@ syscon utime UTIME_OMIT 0x3ffffffe 0x3ffffffe 0x3ffffffe -2 -1 0x3ffff # # group name GNU/Systemd GNU/Systemd (Aarch64) XNU's Not UNIX! FreeBSD OpenBSD NetBSD The New Technology Commentary syscon auxv AT_EXECFD 2 2 0 2 0 2 0 # file descriptor of program -syscon auxv AT_PHDR 3 3 0 3 0 3 0 # address of program headers of executable -syscon auxv AT_PHENT 4 4 0 4 0 4 0 -syscon auxv AT_PHNUM 5 5 0 5 0 5 0 -syscon auxv AT_PAGESZ 6 6 0 6 0 6 0 -syscon auxv AT_BASE 7 7 0 7 0 7 0 # address of program interpreter +syscon auxv AT_PHDR 3 3 3 3 0 3 0 # address of program headers of executable +syscon auxv AT_PHENT 4 4 4 4 0 4 0 +syscon auxv AT_PHNUM 5 5 5 5 0 5 0 +syscon auxv AT_PAGESZ 6 6 6 6 0 6 0 +syscon auxv AT_BASE 7 7 7 7 0 7 0 # address of program interpreter syscon auxv AT_FLAGS 8 8 0 8 0 8 0 -syscon auxv AT_ENTRY 9 9 0 9 0 9 0 # entry address of executable +syscon auxv AT_ENTRY 9 9 9 9 0 9 0 # entry address of executable syscon auxv AT_NOTELF 10 10 0 10 0 0 0 syscon auxv AT_OSRELDATE 0 0 0 18 0 0 0 -syscon auxv AT_UID 11 11 0 0 0 2001 0 -syscon auxv AT_EUID 12 12 0 0 0 2000 0 -syscon auxv AT_GID 13 13 0 0 0 2003 0 -syscon auxv AT_EGID 14 14 0 0 0 2002 0 +syscon auxv AT_UID 11 11 11 0 0 2001 0 +syscon auxv AT_EUID 12 12 12 0 0 2000 0 +syscon auxv AT_GID 13 13 13 0 0 2003 0 +syscon auxv AT_EGID 14 14 14 0 0 2002 0 syscon auxv AT_PLATFORM 15 15 0 0 0 0 0 # address of string with hardware platform for rpath interpretation -syscon auxv AT_HWCAP 16 16 0 0 0 0 0 +syscon auxv AT_HWCAP 16 16 16 0 0 0 0 syscon auxv AT_CLKTCK 17 17 0 0 0 0 0 syscon auxv AT_DCACHEBSIZE 19 19 0 0 0 0 0 syscon auxv AT_ICACHEBSIZE 20 20 0 0 0 0 0 syscon auxv AT_UCACHEBSIZE 21 21 0 0 0 0 0 -syscon auxv AT_SECURE 23 23 0 0 0 0 0 +syscon auxv AT_SECURE 23 23 23 0 0 0 0 syscon auxv AT_BASE_PLATFORM 24 24 0 0 0 0 0 -syscon auxv AT_RANDOM 25 25 0 16 0 0 0 # address of sixteen bytes of random data; AT_CANARY on FreeBSD whose AT_CANARYLEN should be 64 -syscon auxv AT_HWCAP2 26 26 0 0 0 0 0 +syscon auxv AT_RANDOM 25 25 25 16 0 0 0 # address of sixteen bytes of random data; AT_CANARY on FreeBSD whose AT_CANARYLEN should be 64 +syscon auxv AT_HWCAP2 26 26 26 0 0 0 0 syscon auxv AT_EXECFN 31 31 31 15 999 2014 31 # address of string containing first argument passed to execve() used when running program; AT_EXECPATH on FreeBSD syscon auxv AT_SYSINFO_EHDR 33 33 0 0 0 0 0 syscon auxv AT_STACKBASE 0 0 0 0 0 13 0 diff --git a/libc/sysv/consts/AT_BASE.S b/libc/sysv/consts/AT_BASE.S index a615c9b79..336ef23bb 100644 --- a/libc/sysv/consts/AT_BASE.S +++ b/libc/sysv/consts/AT_BASE.S @@ -1,2 +1,2 @@ #include "libc/sysv/consts/syscon.internal.h" -.syscon auxv,AT_BASE,7,7,0,7,0,7,0 +.syscon auxv,AT_BASE,7,7,7,7,0,7,0 diff --git a/libc/sysv/consts/AT_EGID.S b/libc/sysv/consts/AT_EGID.S index 1440256e0..495f12c1d 100644 --- a/libc/sysv/consts/AT_EGID.S +++ b/libc/sysv/consts/AT_EGID.S @@ -1,2 +1,2 @@ #include "libc/sysv/consts/syscon.internal.h" -.syscon auxv,AT_EGID,14,14,0,0,0,2002,0 +.syscon auxv,AT_EGID,14,14,14,0,0,2002,0 diff --git a/libc/sysv/consts/AT_ENTRY.S b/libc/sysv/consts/AT_ENTRY.S index 8ab80db4c..6f00013d1 100644 --- a/libc/sysv/consts/AT_ENTRY.S +++ b/libc/sysv/consts/AT_ENTRY.S @@ -1,2 +1,2 @@ #include "libc/sysv/consts/syscon.internal.h" -.syscon auxv,AT_ENTRY,9,9,0,9,0,9,0 +.syscon auxv,AT_ENTRY,9,9,9,9,0,9,0 diff --git a/libc/sysv/consts/AT_EUID.S b/libc/sysv/consts/AT_EUID.S index 1b3241d6f..c902ed5c6 100644 --- a/libc/sysv/consts/AT_EUID.S +++ b/libc/sysv/consts/AT_EUID.S @@ -1,2 +1,2 @@ #include "libc/sysv/consts/syscon.internal.h" -.syscon auxv,AT_EUID,12,12,0,0,0,2000,0 +.syscon auxv,AT_EUID,12,12,12,0,0,2000,0 diff --git a/libc/sysv/consts/AT_GID.S b/libc/sysv/consts/AT_GID.S index eaf124dd5..aab153978 100644 --- a/libc/sysv/consts/AT_GID.S +++ b/libc/sysv/consts/AT_GID.S @@ -1,2 +1,2 @@ #include "libc/sysv/consts/syscon.internal.h" -.syscon auxv,AT_GID,13,13,0,0,0,2003,0 +.syscon auxv,AT_GID,13,13,13,0,0,2003,0 diff --git a/libc/sysv/consts/AT_HWCAP.S b/libc/sysv/consts/AT_HWCAP.S index 60b86578f..b7ca74fc7 100644 --- a/libc/sysv/consts/AT_HWCAP.S +++ b/libc/sysv/consts/AT_HWCAP.S @@ -1,2 +1,2 @@ #include "libc/sysv/consts/syscon.internal.h" -.syscon auxv,AT_HWCAP,16,16,0,0,0,0,0 +.syscon auxv,AT_HWCAP,16,16,16,0,0,0,0 diff --git a/libc/sysv/consts/AT_HWCAP2.S b/libc/sysv/consts/AT_HWCAP2.S index 0f952a46e..f62df4f67 100644 --- a/libc/sysv/consts/AT_HWCAP2.S +++ b/libc/sysv/consts/AT_HWCAP2.S @@ -1,2 +1,2 @@ #include "libc/sysv/consts/syscon.internal.h" -.syscon auxv,AT_HWCAP2,26,26,0,0,0,0,0 +.syscon auxv,AT_HWCAP2,26,26,26,0,0,0,0 diff --git a/libc/sysv/consts/AT_PAGESZ.S b/libc/sysv/consts/AT_PAGESZ.S index 279661fac..6334dd955 100644 --- a/libc/sysv/consts/AT_PAGESZ.S +++ b/libc/sysv/consts/AT_PAGESZ.S @@ -1,2 +1,2 @@ #include "libc/sysv/consts/syscon.internal.h" -.syscon auxv,AT_PAGESZ,6,6,0,6,0,6,0 +.syscon auxv,AT_PAGESZ,6,6,6,6,0,6,0 diff --git a/libc/sysv/consts/AT_PHDR.S b/libc/sysv/consts/AT_PHDR.S index 79c80fff6..644b26b8f 100644 --- a/libc/sysv/consts/AT_PHDR.S +++ b/libc/sysv/consts/AT_PHDR.S @@ -1,2 +1,2 @@ #include "libc/sysv/consts/syscon.internal.h" -.syscon auxv,AT_PHDR,3,3,0,3,0,3,0 +.syscon auxv,AT_PHDR,3,3,3,3,0,3,0 diff --git a/libc/sysv/consts/AT_PHENT.S b/libc/sysv/consts/AT_PHENT.S index 44938ff3d..1df7f18d0 100644 --- a/libc/sysv/consts/AT_PHENT.S +++ b/libc/sysv/consts/AT_PHENT.S @@ -1,2 +1,2 @@ #include "libc/sysv/consts/syscon.internal.h" -.syscon auxv,AT_PHENT,4,4,0,4,0,4,0 +.syscon auxv,AT_PHENT,4,4,4,4,0,4,0 diff --git a/libc/sysv/consts/AT_PHNUM.S b/libc/sysv/consts/AT_PHNUM.S index 7f948612f..261fbcf5d 100644 --- a/libc/sysv/consts/AT_PHNUM.S +++ b/libc/sysv/consts/AT_PHNUM.S @@ -1,2 +1,2 @@ #include "libc/sysv/consts/syscon.internal.h" -.syscon auxv,AT_PHNUM,5,5,0,5,0,5,0 +.syscon auxv,AT_PHNUM,5,5,5,5,0,5,0 diff --git a/libc/sysv/consts/AT_RANDOM.S b/libc/sysv/consts/AT_RANDOM.S index d3f7368b1..29fa0fc66 100644 --- a/libc/sysv/consts/AT_RANDOM.S +++ b/libc/sysv/consts/AT_RANDOM.S @@ -1,2 +1,2 @@ #include "libc/sysv/consts/syscon.internal.h" -.syscon auxv,AT_RANDOM,25,25,0,16,0,0,0 +.syscon auxv,AT_RANDOM,25,25,25,16,0,0,0 diff --git a/libc/sysv/consts/AT_SECURE.S b/libc/sysv/consts/AT_SECURE.S index 802e78088..b406384c8 100644 --- a/libc/sysv/consts/AT_SECURE.S +++ b/libc/sysv/consts/AT_SECURE.S @@ -1,2 +1,2 @@ #include "libc/sysv/consts/syscon.internal.h" -.syscon auxv,AT_SECURE,23,23,0,0,0,0,0 +.syscon auxv,AT_SECURE,23,23,23,0,0,0,0 diff --git a/libc/sysv/consts/AT_UID.S b/libc/sysv/consts/AT_UID.S index 52527a04b..5a171a0be 100644 --- a/libc/sysv/consts/AT_UID.S +++ b/libc/sysv/consts/AT_UID.S @@ -1,2 +1,2 @@ #include "libc/sysv/consts/syscon.internal.h" -.syscon auxv,AT_UID,11,11,0,0,0,2001,0 +.syscon auxv,AT_UID,11,11,11,0,0,2001,0 diff --git a/libc/sysv/consts/EACCES.S b/libc/sysv/consts/EACCES.S index 02a7999a7..32c7007bf 100644 --- a/libc/sysv/consts/EACCES.S +++ b/libc/sysv/consts/EACCES.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,EACCES,13,13,13,13,13,13,5 +#ifdef __x86_64__ .yoink kDos2Errno.EACCES +#endif diff --git a/libc/sysv/consts/EADDRINUSE.S b/libc/sysv/consts/EADDRINUSE.S index c5c26e146..811385924 100644 --- a/libc/sysv/consts/EADDRINUSE.S +++ b/libc/sysv/consts/EADDRINUSE.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,EADDRINUSE,98,98,48,48,48,48,10048 +#ifdef __x86_64__ .yoink kDos2Errno.EADDRINUSE +#endif diff --git a/libc/sysv/consts/EADDRNOTAVAIL.S b/libc/sysv/consts/EADDRNOTAVAIL.S index 5cb217720..2a027b769 100644 --- a/libc/sysv/consts/EADDRNOTAVAIL.S +++ b/libc/sysv/consts/EADDRNOTAVAIL.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,EADDRNOTAVAIL,99,99,49,49,49,49,10049 +#ifdef __x86_64__ .yoink kDos2Errno.EADDRNOTAVAIL +#endif diff --git a/libc/sysv/consts/EAGAIN.S b/libc/sysv/consts/EAGAIN.S index 4f1d9db61..93e25f774 100644 --- a/libc/sysv/consts/EAGAIN.S +++ b/libc/sysv/consts/EAGAIN.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,EAGAIN,11,11,35,35,35,35,10035 +#ifdef __x86_64__ .yoink kDos2Errno.EAGAIN +#endif diff --git a/libc/sysv/consts/EBADF.S b/libc/sysv/consts/EBADF.S index 7b60571b9..8c1d707d4 100644 --- a/libc/sysv/consts/EBADF.S +++ b/libc/sysv/consts/EBADF.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,EBADF,9,9,9,9,9,9,6 +#ifdef __x86_64__ .yoink kDos2Errno.EBADF +#endif diff --git a/libc/sysv/consts/ECONNABORTED.S b/libc/sysv/consts/ECONNABORTED.S index b3101edbd..3f6b0acb8 100644 --- a/libc/sysv/consts/ECONNABORTED.S +++ b/libc/sysv/consts/ECONNABORTED.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,ECONNABORTED,103,103,53,53,53,53,10053 +#ifdef __x86_64__ .yoink kDos2Errno.ECONNABORTED +#endif diff --git a/libc/sysv/consts/ECONNREFUSED.S b/libc/sysv/consts/ECONNREFUSED.S index c0b35afd8..fc52ef415 100644 --- a/libc/sysv/consts/ECONNREFUSED.S +++ b/libc/sysv/consts/ECONNREFUSED.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,ECONNREFUSED,111,111,61,61,61,61,10061 +#ifdef __x86_64__ .yoink kDos2Errno.ECONNREFUSED +#endif diff --git a/libc/sysv/consts/ECONNRESET.S b/libc/sysv/consts/ECONNRESET.S index 4c867722a..dc892b1b0 100644 --- a/libc/sysv/consts/ECONNRESET.S +++ b/libc/sysv/consts/ECONNRESET.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,ECONNRESET,104,104,54,54,54,54,10054 +#ifdef __x86_64__ .yoink kDos2Errno.ECONNRESET +#endif diff --git a/libc/sysv/consts/EDQUOT.S b/libc/sysv/consts/EDQUOT.S index b75741071..c9f418f06 100644 --- a/libc/sysv/consts/EDQUOT.S +++ b/libc/sysv/consts/EDQUOT.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,EDQUOT,122,122,69,69,69,69,1816 +#ifdef __x86_64__ .yoink kDos2Errno.EDQUOT +#endif diff --git a/libc/sysv/consts/EEXIST.S b/libc/sysv/consts/EEXIST.S index 00e1141db..b6f98fa61 100644 --- a/libc/sysv/consts/EEXIST.S +++ b/libc/sysv/consts/EEXIST.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,EEXIST,17,17,17,17,17,17,183 +#ifdef __x86_64__ .yoink kDos2Errno.EEXIST +#endif diff --git a/libc/sysv/consts/EFAULT.S b/libc/sysv/consts/EFAULT.S index 3b057fc84..e03778962 100644 --- a/libc/sysv/consts/EFAULT.S +++ b/libc/sysv/consts/EFAULT.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,EFAULT,14,14,14,14,14,14,487 +#ifdef __x86_64__ .yoink kDos2Errno.EFAULT +#endif diff --git a/libc/sysv/consts/EHOSTUNREACH.S b/libc/sysv/consts/EHOSTUNREACH.S index 371068397..9a1ab9ec9 100644 --- a/libc/sysv/consts/EHOSTUNREACH.S +++ b/libc/sysv/consts/EHOSTUNREACH.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,EHOSTUNREACH,113,113,65,65,65,65,10065 +#ifdef __x86_64__ .yoink kDos2Errno.EHOSTUNREACH +#endif diff --git a/libc/sysv/consts/EINPROGRESS.S b/libc/sysv/consts/EINPROGRESS.S index 3186dd3a8..18d61c7fc 100644 --- a/libc/sysv/consts/EINPROGRESS.S +++ b/libc/sysv/consts/EINPROGRESS.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,EINPROGRESS,115,115,36,36,36,36,10036 +#ifdef __x86_64__ .yoink kDos2Errno.EINPROGRESS +#endif diff --git a/libc/sysv/consts/EINTR.S b/libc/sysv/consts/EINTR.S index f8059f87a..1ccfba19b 100644 --- a/libc/sysv/consts/EINTR.S +++ b/libc/sysv/consts/EINTR.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,EINTR,4,4,4,4,4,4,10004 +#ifdef __x86_64__ .yoink kDos2Errno.EINTR +#endif diff --git a/libc/sysv/consts/EINVAL.S b/libc/sysv/consts/EINVAL.S index f95c0511d..17730e136 100644 --- a/libc/sysv/consts/EINVAL.S +++ b/libc/sysv/consts/EINVAL.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,EINVAL,22,22,22,22,22,22,87 +#ifdef __x86_64__ .yoink kDos2Errno.EINVAL +#endif diff --git a/libc/sysv/consts/EISCONN.S b/libc/sysv/consts/EISCONN.S index d374a7ef6..ec1f0284d 100644 --- a/libc/sysv/consts/EISCONN.S +++ b/libc/sysv/consts/EISCONN.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,EISCONN,106,106,56,56,56,56,10056 +#ifdef __x86_64__ .yoink kDos2Errno.EISCONN +#endif diff --git a/libc/sysv/consts/EMSGSIZE.S b/libc/sysv/consts/EMSGSIZE.S index ef5b5f00a..348831fd1 100644 --- a/libc/sysv/consts/EMSGSIZE.S +++ b/libc/sysv/consts/EMSGSIZE.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,EMSGSIZE,90,90,40,40,40,40,10040 +#ifdef __x86_64__ .yoink kDos2Errno.EMSGSIZE +#endif diff --git a/libc/sysv/consts/ENAMETOOLONG.S b/libc/sysv/consts/ENAMETOOLONG.S index 2e9f4abb7..8954bee2f 100644 --- a/libc/sysv/consts/ENAMETOOLONG.S +++ b/libc/sysv/consts/ENAMETOOLONG.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,ENAMETOOLONG,36,36,63,63,63,63,10063 +#ifdef __x86_64__ .yoink kDos2Errno.ENAMETOOLONG +#endif diff --git a/libc/sysv/consts/ENETDOWN.S b/libc/sysv/consts/ENETDOWN.S index f434b5bd7..77f5e67be 100644 --- a/libc/sysv/consts/ENETDOWN.S +++ b/libc/sysv/consts/ENETDOWN.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,ENETDOWN,100,100,50,50,50,50,10050 +#ifdef __x86_64__ .yoink kDos2Errno.ENETDOWN +#endif diff --git a/libc/sysv/consts/ENETUNREACH.S b/libc/sysv/consts/ENETUNREACH.S index 4b930289d..983b57303 100644 --- a/libc/sysv/consts/ENETUNREACH.S +++ b/libc/sysv/consts/ENETUNREACH.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,ENETUNREACH,101,101,51,51,51,51,10051 +#ifdef __x86_64__ .yoink kDos2Errno.ENETUNREACH +#endif diff --git a/libc/sysv/consts/ENOENT.S b/libc/sysv/consts/ENOENT.S index d02a51a85..275b43a48 100644 --- a/libc/sysv/consts/ENOENT.S +++ b/libc/sysv/consts/ENOENT.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,ENOENT,2,2,2,2,2,2,2 +#ifdef __x86_64__ .yoink kDos2Errno.ENOENT +#endif diff --git a/libc/sysv/consts/ENOMEM.S b/libc/sysv/consts/ENOMEM.S index 225556bdc..248bb2845 100644 --- a/libc/sysv/consts/ENOMEM.S +++ b/libc/sysv/consts/ENOMEM.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,ENOMEM,12,12,12,12,12,12,14 +#ifdef __x86_64__ .yoink kDos2Errno.ENOMEM +#endif diff --git a/libc/sysv/consts/ENOSYS.S b/libc/sysv/consts/ENOSYS.S index 94987b066..61213c577 100644 --- a/libc/sysv/consts/ENOSYS.S +++ b/libc/sysv/consts/ENOSYS.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,ENOSYS,38,38,78,78,78,78,1 +#ifdef __x86_64__ .yoink kDos2Errno.ENOSYS +#endif diff --git a/libc/sysv/consts/ENOTEMPTY.S b/libc/sysv/consts/ENOTEMPTY.S index 2793c91ad..c43804085 100644 --- a/libc/sysv/consts/ENOTEMPTY.S +++ b/libc/sysv/consts/ENOTEMPTY.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,ENOTEMPTY,39,39,66,66,66,66,145 +#ifdef __x86_64__ .yoink kDos2Errno.ENOTEMPTY +#endif diff --git a/libc/sysv/consts/ENOTSUP.S b/libc/sysv/consts/ENOTSUP.S index 2d2d59354..65d07080f 100644 --- a/libc/sysv/consts/ENOTSUP.S +++ b/libc/sysv/consts/ENOTSUP.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,ENOTSUP,95,95,45,45,91,86,10045 +#ifdef __x86_64__ .yoink kDos2Errno.ENOTSUP +#endif diff --git a/libc/sysv/consts/EPIPE.S b/libc/sysv/consts/EPIPE.S index b006dcb08..a43a4703c 100644 --- a/libc/sysv/consts/EPIPE.S +++ b/libc/sysv/consts/EPIPE.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,EPIPE,32,32,32,32,32,32,109 +#ifdef __x86_64__ .yoink kDos2Errno.EPIPE +#endif diff --git a/libc/sysv/consts/ETIMEDOUT.S b/libc/sysv/consts/ETIMEDOUT.S index 0149565f7..d1752b258 100644 --- a/libc/sysv/consts/ETIMEDOUT.S +++ b/libc/sysv/consts/ETIMEDOUT.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon errno,ETIMEDOUT,110,110,60,60,60,60,1460 +#ifdef __x86_64__ .yoink kDos2Errno.ETIMEDOUT +#endif diff --git a/libc/sysv/consts/EWOULDBLOCK.S b/libc/sysv/consts/EWOULDBLOCK.S index 82ff57f56..cf76ed289 100644 --- a/libc/sysv/consts/EWOULDBLOCK.S +++ b/libc/sysv/consts/EWOULDBLOCK.S @@ -1,3 +1,5 @@ #include "libc/sysv/consts/syscon.internal.h" .syscon compat,EWOULDBLOCK,11,11,35,35,35,35,10035 +#ifdef __x86_64__ .yoink kDos2Errno.EWOULDBLOCK +#endif diff --git a/libc/sysv/consts/hwap.h b/libc/sysv/consts/hwcap.h similarity index 92% rename from libc/sysv/consts/hwap.h rename to libc/sysv/consts/hwcap.h index 5ea8ecbb6..711e2456c 100644 --- a/libc/sysv/consts/hwap.h +++ b/libc/sysv/consts/hwcap.h @@ -1,5 +1,5 @@ -#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_HWAP_H_ -#define COSMOPOLITAN_LIBC_SYSV_CONSTS_HWAP_H_ +#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_HWCAP_H_ +#define COSMOPOLITAN_LIBC_SYSV_CONSTS_HWCAP_H_ #ifdef __aarch64__ // Feature bits for getauxval(AT_HWCAP) on AARCH64 GNU/SystemD. @@ -58,4 +58,4 @@ #define HWCAP2_MTE (1 << 18) #endif /* __aarch64__ */ -#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_HWAP_H_ */ +#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_HWCAP_H_ */ diff --git a/libc/sysv/consts/syscon.internal.h b/libc/sysv/consts/syscon.internal.h index 3150d619d..57ba9eb22 100644 --- a/libc/sysv/consts/syscon.internal.h +++ b/libc/sysv/consts/syscon.internal.h @@ -18,60 +18,61 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/dce.h" #include "libc/macros.internal.h" -/* clang-format off */ +// clang-format off + +#ifdef __x86_64__ +#define ENCODE .uleb128 +.yoink _init_systemfive +#else +#define ENCODE .balign 8 ; .quad +#endif .macro .syscon group:req name:req linux:req linux_aarch64:req xnu:req freebsd:req openbsd:req netbsd:req windows:req -#ifdef __x86_64__ - .yoink _init_systemfive - .section .piro.bss.sort.syscon.2.\group\().\name,"aw",@nobits + .balign 8 \name: .quad 0 .endobj \name,globl .previous #if SupportsLinux() || SupportsMetal() .section .sort.rodata.syscon.linux.2.\group\().\name,"a",@progbits - .uleb128 \linux +#ifdef __aarch64__ + ENCODE \linux_aarch64 +#else + ENCODE \linux +#endif .previous #endif #if SupportsXnu() .section .sort.rodata.syscon.xnu.2.\group\().\name,"a",@progbits - .uleb128 \xnu + ENCODE \xnu .previous #endif #if SupportsFreebsd() .section .sort.rodata.syscon.freebsd.2.\group\().\name,"a",@progbits - .uleb128 \freebsd + ENCODE \freebsd .previous #endif #if SupportsOpenbsd() .section .sort.rodata.syscon.openbsd.2.\group\().\name,"a",@progbits - .uleb128 \openbsd + ENCODE \openbsd .previous #endif #if SupportsNetbsd() .section .sort.rodata.syscon.netbsd.2.\group\().\name,"a",@progbits - .uleb128 \netbsd + ENCODE \netbsd .previous #endif #if SupportsWindows() .section .sort.rodata.syscon.windows.2.\group\().\name,"a",@progbits - .uleb128 \windows + ENCODE \windows .previous #endif -#else - .section .rodata,"a",@progbits - .balign 8 -\name: .quad \linux_aarch64 - .endobj \name,globl - .previous -#endif /* __x86_64__ */ - .endm diff --git a/libc/sysv/dos2errno/EACCES.S b/libc/sysv/dos2errno/EACCES.S index 4af9d1a26..6c93f8388 100644 --- a/libc/sysv/dos2errno/EACCES.S +++ b/libc/sysv/dos2errno/EACCES.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/EADDRINUSE.S b/libc/sysv/dos2errno/EADDRINUSE.S index 32a1a6491..f8c3cfbe9 100644 --- a/libc/sysv/dos2errno/EADDRINUSE.S +++ b/libc/sysv/dos2errno/EADDRINUSE.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/EADDRNOTAVAIL.S b/libc/sysv/dos2errno/EADDRNOTAVAIL.S index e33fb13e8..9c07c3df7 100644 --- a/libc/sysv/dos2errno/EADDRNOTAVAIL.S +++ b/libc/sysv/dos2errno/EADDRNOTAVAIL.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/EAGAIN.S b/libc/sysv/dos2errno/EAGAIN.S index 6fa2738b8..f5f390b10 100644 --- a/libc/sysv/dos2errno/EAGAIN.S +++ b/libc/sysv/dos2errno/EAGAIN.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/EBADF.S b/libc/sysv/dos2errno/EBADF.S index ce6690a71..c259a0ea2 100644 --- a/libc/sysv/dos2errno/EBADF.S +++ b/libc/sysv/dos2errno/EBADF.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/ECONNABORTED.S b/libc/sysv/dos2errno/ECONNABORTED.S index a437be229..142b28668 100644 --- a/libc/sysv/dos2errno/ECONNABORTED.S +++ b/libc/sysv/dos2errno/ECONNABORTED.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/ECONNREFUSED.S b/libc/sysv/dos2errno/ECONNREFUSED.S index 4e11016ef..e3442aef2 100644 --- a/libc/sysv/dos2errno/ECONNREFUSED.S +++ b/libc/sysv/dos2errno/ECONNREFUSED.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/ECONNRESET.S b/libc/sysv/dos2errno/ECONNRESET.S index e77f5698d..d3dc2cef2 100644 --- a/libc/sysv/dos2errno/ECONNRESET.S +++ b/libc/sysv/dos2errno/ECONNRESET.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/EDQUOT.S b/libc/sysv/dos2errno/EDQUOT.S index 160f01fa3..0c24092d5 100644 --- a/libc/sysv/dos2errno/EDQUOT.S +++ b/libc/sysv/dos2errno/EDQUOT.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/EEXIST.S b/libc/sysv/dos2errno/EEXIST.S index 039fd6fbb..4aabcae92 100644 --- a/libc/sysv/dos2errno/EEXIST.S +++ b/libc/sysv/dos2errno/EEXIST.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/EFAULT.S b/libc/sysv/dos2errno/EFAULT.S index 1a8f5f7f5..04d391aed 100644 --- a/libc/sysv/dos2errno/EFAULT.S +++ b/libc/sysv/dos2errno/EFAULT.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/EHOSTUNREACH.S b/libc/sysv/dos2errno/EHOSTUNREACH.S index 12dc9aa03..23ea410fe 100644 --- a/libc/sysv/dos2errno/EHOSTUNREACH.S +++ b/libc/sysv/dos2errno/EHOSTUNREACH.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/EINPROGRESS.S b/libc/sysv/dos2errno/EINPROGRESS.S index 80bf427c5..62deee368 100644 --- a/libc/sysv/dos2errno/EINPROGRESS.S +++ b/libc/sysv/dos2errno/EINPROGRESS.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/EINTR.S b/libc/sysv/dos2errno/EINTR.S index 927e3bdb6..6c002f38e 100644 --- a/libc/sysv/dos2errno/EINTR.S +++ b/libc/sysv/dos2errno/EINTR.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/EINVAL.S b/libc/sysv/dos2errno/EINVAL.S index 78a3951fa..6947dd7a5 100644 --- a/libc/sysv/dos2errno/EINVAL.S +++ b/libc/sysv/dos2errno/EINVAL.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv @@ -10,5 +13,5 @@ kDos2Errno.EINVAL: .e kNtErrorNotAReparsePoint,EINVAL .e kNtErrorInvalidFunction,EINVAL - .e WSAEINVAL,EINVAL .e kNtErrorNegativeSeek,EINVAL + .e WSAEINVAL,EINVAL diff --git a/libc/sysv/dos2errno/EISCONN.S b/libc/sysv/dos2errno/EISCONN.S index eff148e71..6248f9f1b 100644 --- a/libc/sysv/dos2errno/EISCONN.S +++ b/libc/sysv/dos2errno/EISCONN.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/EMSGSIZE.S b/libc/sysv/dos2errno/EMSGSIZE.S index d1cc178e2..5e6b1c622 100644 --- a/libc/sysv/dos2errno/EMSGSIZE.S +++ b/libc/sysv/dos2errno/EMSGSIZE.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/ENAMETOOLONG.S b/libc/sysv/dos2errno/ENAMETOOLONG.S index 9d0090fca..cf15aeb66 100644 --- a/libc/sysv/dos2errno/ENAMETOOLONG.S +++ b/libc/sysv/dos2errno/ENAMETOOLONG.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/ENETDOWN.S b/libc/sysv/dos2errno/ENETDOWN.S index 039f89079..ec5d6294d 100644 --- a/libc/sysv/dos2errno/ENETDOWN.S +++ b/libc/sysv/dos2errno/ENETDOWN.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/ENETUNREACH.S b/libc/sysv/dos2errno/ENETUNREACH.S index 37ada58a5..4cecc7b3c 100644 --- a/libc/sysv/dos2errno/ENETUNREACH.S +++ b/libc/sysv/dos2errno/ENETUNREACH.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/ENOENT.S b/libc/sysv/dos2errno/ENOENT.S index 74b0890d1..9c8201e5c 100644 --- a/libc/sysv/dos2errno/ENOENT.S +++ b/libc/sysv/dos2errno/ENOENT.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/ENOMEM.S b/libc/sysv/dos2errno/ENOMEM.S index 0bee86f34..d88bd334d 100644 --- a/libc/sysv/dos2errno/ENOMEM.S +++ b/libc/sysv/dos2errno/ENOMEM.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/ENOSYS.S b/libc/sysv/dos2errno/ENOSYS.S index 145df291c..f986cc67e 100644 --- a/libc/sysv/dos2errno/ENOSYS.S +++ b/libc/sysv/dos2errno/ENOSYS.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/ENOTEMPTY.S b/libc/sysv/dos2errno/ENOTEMPTY.S index e1a33ba6d..602056695 100644 --- a/libc/sysv/dos2errno/ENOTEMPTY.S +++ b/libc/sysv/dos2errno/ENOTEMPTY.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/ENOTSUP.S b/libc/sysv/dos2errno/ENOTSUP.S index 509536622..d0767544e 100644 --- a/libc/sysv/dos2errno/ENOTSUP.S +++ b/libc/sysv/dos2errno/ENOTSUP.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/EPIPE.S b/libc/sysv/dos2errno/EPIPE.S index b20c5eac0..dcaaefacb 100644 --- a/libc/sysv/dos2errno/EPIPE.S +++ b/libc/sysv/dos2errno/EPIPE.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/ETIMEDOUT.S b/libc/sysv/dos2errno/ETIMEDOUT.S index 1b8a42cb5..6a167a4e7 100644 --- a/libc/sysv/dos2errno/ETIMEDOUT.S +++ b/libc/sysv/dos2errno/ETIMEDOUT.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/dos2errno/EWOULDBLOCK.S b/libc/sysv/dos2errno/EWOULDBLOCK.S index 6e20c2ccf..658dc6198 100644 --- a/libc/sysv/dos2errno/EWOULDBLOCK.S +++ b/libc/sysv/dos2errno/EWOULDBLOCK.S @@ -1,5 +1,8 @@ // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/sysv/errfun.S b/libc/sysv/errfun.S index ca7c85a60..90cde2b5b 100644 --- a/libc/sysv/errfun.S +++ b/libc/sysv/errfun.S @@ -20,21 +20,9 @@ .text.unlikely __errfun: -#ifdef __x86_64__ call __errno_location mov %ecx,(%rax) push $-1 pop %rax .leafepilogue // .leafprologue is in errfuns/... -#elif defined(__aarch64__) - stp x19,x30,[sp,#-16]! - mov w19,w0 - bl __errno_location - str w19,[x0] - mov x0,#-1 - ldp x19,x30,[sp],#16 - ret -#else -#error "unsupported architecture" -#endif .endfn __errfun,globl,hidden diff --git a/libc/sysv/errfun2.c b/libc/sysv/errfun2.c new file mode 100644 index 000000000..663307982 --- /dev/null +++ b/libc/sysv/errfun2.c @@ -0,0 +1,27 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Copyright 2023 Justine Alexandra Roberts Tunney │ +│ │ +│ Permission to use, copy, modify, and/or distribute this software for │ +│ any purpose with or without fee is hereby granted, provided that the │ +│ above copyright notice and this permission notice appear in all copies. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ +│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ +│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ +│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ +│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ +│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ +│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ +│ PERFORMANCE OF THIS SOFTWARE. │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/errno.h" +#ifndef __x86_64__ + +long __errfun(int e) { + errno = e; + return -1; +} + +#endif /* __x86_64__ */ diff --git a/libc/sysv/errfuns/e2big.S b/libc/sysv/errfuns/e2big.S index bea27f3c8..17080bc72 100644 --- a/libc/sysv/errfuns/e2big.S +++ b/libc/sysv/errfuns/e2big.S @@ -9,7 +9,7 @@ e2big: jmp __errfun #elif defined(__aarch64__) adrp x1,E2BIG - ldr w0,[x1,#:lo12:E2BIG] + ldrsw x0,[x1,#:lo12:E2BIG] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eacces.S b/libc/sysv/errfuns/eacces.S index 46f93093a..f2d0dcc4b 100644 --- a/libc/sysv/errfuns/eacces.S +++ b/libc/sysv/errfuns/eacces.S @@ -9,7 +9,7 @@ eacces: jmp __errfun #elif defined(__aarch64__) adrp x1,EACCES - ldr w0,[x1,#:lo12:EACCES] + ldrsw x0,[x1,#:lo12:EACCES] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eaddrinuse.S b/libc/sysv/errfuns/eaddrinuse.S index 11c08f442..6450019cb 100644 --- a/libc/sysv/errfuns/eaddrinuse.S +++ b/libc/sysv/errfuns/eaddrinuse.S @@ -9,7 +9,7 @@ eaddrinuse: jmp __errfun #elif defined(__aarch64__) adrp x1,EADDRINUSE - ldr w0,[x1,#:lo12:EADDRINUSE] + ldrsw x0,[x1,#:lo12:EADDRINUSE] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eaddrnotavail.S b/libc/sysv/errfuns/eaddrnotavail.S index 8ff3e5df1..c82654523 100644 --- a/libc/sysv/errfuns/eaddrnotavail.S +++ b/libc/sysv/errfuns/eaddrnotavail.S @@ -9,7 +9,7 @@ eaddrnotavail: jmp __errfun #elif defined(__aarch64__) adrp x1,EADDRNOTAVAIL - ldr w0,[x1,#:lo12:EADDRNOTAVAIL] + ldrsw x0,[x1,#:lo12:EADDRNOTAVAIL] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eadv.S b/libc/sysv/errfuns/eadv.S index 208fca17a..4af71a93f 100644 --- a/libc/sysv/errfuns/eadv.S +++ b/libc/sysv/errfuns/eadv.S @@ -9,7 +9,7 @@ eadv: jmp __errfun #elif defined(__aarch64__) adrp x1,EADV - ldr w0,[x1,#:lo12:EADV] + ldrsw x0,[x1,#:lo12:EADV] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eafnosupport.S b/libc/sysv/errfuns/eafnosupport.S index 177856c6c..f8d5c1235 100644 --- a/libc/sysv/errfuns/eafnosupport.S +++ b/libc/sysv/errfuns/eafnosupport.S @@ -9,7 +9,7 @@ eafnosupport: jmp __errfun #elif defined(__aarch64__) adrp x1,EAFNOSUPPORT - ldr w0,[x1,#:lo12:EAFNOSUPPORT] + ldrsw x0,[x1,#:lo12:EAFNOSUPPORT] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eagain.S b/libc/sysv/errfuns/eagain.S index 7912501de..244a9249b 100644 --- a/libc/sysv/errfuns/eagain.S +++ b/libc/sysv/errfuns/eagain.S @@ -9,7 +9,7 @@ eagain: jmp __errfun #elif defined(__aarch64__) adrp x1,EAGAIN - ldr w0,[x1,#:lo12:EAGAIN] + ldrsw x0,[x1,#:lo12:EAGAIN] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/ealready.S b/libc/sysv/errfuns/ealready.S index 80bd3ae26..4aebad0de 100644 --- a/libc/sysv/errfuns/ealready.S +++ b/libc/sysv/errfuns/ealready.S @@ -9,7 +9,7 @@ ealready: jmp __errfun #elif defined(__aarch64__) adrp x1,EALREADY - ldr w0,[x1,#:lo12:EALREADY] + ldrsw x0,[x1,#:lo12:EALREADY] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/ebade.S b/libc/sysv/errfuns/ebade.S index d8ed6c6a4..0174c5a30 100644 --- a/libc/sysv/errfuns/ebade.S +++ b/libc/sysv/errfuns/ebade.S @@ -9,7 +9,7 @@ ebade: jmp __errfun #elif defined(__aarch64__) adrp x1,EBADE - ldr w0,[x1,#:lo12:EBADE] + ldrsw x0,[x1,#:lo12:EBADE] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/ebadf.S b/libc/sysv/errfuns/ebadf.S index db7ed592b..1499c8105 100644 --- a/libc/sysv/errfuns/ebadf.S +++ b/libc/sysv/errfuns/ebadf.S @@ -9,7 +9,7 @@ ebadf: jmp __errfun #elif defined(__aarch64__) adrp x1,EBADF - ldr w0,[x1,#:lo12:EBADF] + ldrsw x0,[x1,#:lo12:EBADF] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/ebadfd.S b/libc/sysv/errfuns/ebadfd.S index f7b2ae247..b7c1a204c 100644 --- a/libc/sysv/errfuns/ebadfd.S +++ b/libc/sysv/errfuns/ebadfd.S @@ -9,7 +9,7 @@ ebadfd: jmp __errfun #elif defined(__aarch64__) adrp x1,EBADFD - ldr w0,[x1,#:lo12:EBADFD] + ldrsw x0,[x1,#:lo12:EBADFD] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/ebadmsg.S b/libc/sysv/errfuns/ebadmsg.S index 08fabb368..1d11a238e 100644 --- a/libc/sysv/errfuns/ebadmsg.S +++ b/libc/sysv/errfuns/ebadmsg.S @@ -9,7 +9,7 @@ ebadmsg: jmp __errfun #elif defined(__aarch64__) adrp x1,EBADMSG - ldr w0,[x1,#:lo12:EBADMSG] + ldrsw x0,[x1,#:lo12:EBADMSG] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/ebadr.S b/libc/sysv/errfuns/ebadr.S index 829aa6bd3..e94358e26 100644 --- a/libc/sysv/errfuns/ebadr.S +++ b/libc/sysv/errfuns/ebadr.S @@ -9,7 +9,7 @@ ebadr: jmp __errfun #elif defined(__aarch64__) adrp x1,EBADR - ldr w0,[x1,#:lo12:EBADR] + ldrsw x0,[x1,#:lo12:EBADR] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/ebadrqc.S b/libc/sysv/errfuns/ebadrqc.S index 8693b574a..a4d0eb790 100644 --- a/libc/sysv/errfuns/ebadrqc.S +++ b/libc/sysv/errfuns/ebadrqc.S @@ -9,7 +9,7 @@ ebadrqc: jmp __errfun #elif defined(__aarch64__) adrp x1,EBADRQC - ldr w0,[x1,#:lo12:EBADRQC] + ldrsw x0,[x1,#:lo12:EBADRQC] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/ebadslt.S b/libc/sysv/errfuns/ebadslt.S index 3bafdc94e..11653b401 100644 --- a/libc/sysv/errfuns/ebadslt.S +++ b/libc/sysv/errfuns/ebadslt.S @@ -9,7 +9,7 @@ ebadslt: jmp __errfun #elif defined(__aarch64__) adrp x1,EBADSLT - ldr w0,[x1,#:lo12:EBADSLT] + ldrsw x0,[x1,#:lo12:EBADSLT] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/ebusy.S b/libc/sysv/errfuns/ebusy.S index c0d380034..2bd15239d 100644 --- a/libc/sysv/errfuns/ebusy.S +++ b/libc/sysv/errfuns/ebusy.S @@ -9,7 +9,7 @@ ebusy: jmp __errfun #elif defined(__aarch64__) adrp x1,EBUSY - ldr w0,[x1,#:lo12:EBUSY] + ldrsw x0,[x1,#:lo12:EBUSY] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/ecanceled.S b/libc/sysv/errfuns/ecanceled.S index 5dfd76e54..57e39253b 100644 --- a/libc/sysv/errfuns/ecanceled.S +++ b/libc/sysv/errfuns/ecanceled.S @@ -9,7 +9,7 @@ ecanceled: jmp __errfun #elif defined(__aarch64__) adrp x1,ECANCELED - ldr w0,[x1,#:lo12:ECANCELED] + ldrsw x0,[x1,#:lo12:ECANCELED] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/echild.S b/libc/sysv/errfuns/echild.S index f852896fb..f86488a0f 100644 --- a/libc/sysv/errfuns/echild.S +++ b/libc/sysv/errfuns/echild.S @@ -9,7 +9,7 @@ echild: jmp __errfun #elif defined(__aarch64__) adrp x1,ECHILD - ldr w0,[x1,#:lo12:ECHILD] + ldrsw x0,[x1,#:lo12:ECHILD] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/echrng.S b/libc/sysv/errfuns/echrng.S index 1881ea80a..30be06936 100644 --- a/libc/sysv/errfuns/echrng.S +++ b/libc/sysv/errfuns/echrng.S @@ -9,7 +9,7 @@ echrng: jmp __errfun #elif defined(__aarch64__) adrp x1,ECHRNG - ldr w0,[x1,#:lo12:ECHRNG] + ldrsw x0,[x1,#:lo12:ECHRNG] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/ecomm.S b/libc/sysv/errfuns/ecomm.S index 702f261f3..fdff163d3 100644 --- a/libc/sysv/errfuns/ecomm.S +++ b/libc/sysv/errfuns/ecomm.S @@ -9,7 +9,7 @@ ecomm: jmp __errfun #elif defined(__aarch64__) adrp x1,ECOMM - ldr w0,[x1,#:lo12:ECOMM] + ldrsw x0,[x1,#:lo12:ECOMM] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/econnaborted.S b/libc/sysv/errfuns/econnaborted.S index 840d16971..630fd4d4b 100644 --- a/libc/sysv/errfuns/econnaborted.S +++ b/libc/sysv/errfuns/econnaborted.S @@ -9,7 +9,7 @@ econnaborted: jmp __errfun #elif defined(__aarch64__) adrp x1,ECONNABORTED - ldr w0,[x1,#:lo12:ECONNABORTED] + ldrsw x0,[x1,#:lo12:ECONNABORTED] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/econnrefused.S b/libc/sysv/errfuns/econnrefused.S index 0e97e257e..c6706270f 100644 --- a/libc/sysv/errfuns/econnrefused.S +++ b/libc/sysv/errfuns/econnrefused.S @@ -9,7 +9,7 @@ econnrefused: jmp __errfun #elif defined(__aarch64__) adrp x1,ECONNREFUSED - ldr w0,[x1,#:lo12:ECONNREFUSED] + ldrsw x0,[x1,#:lo12:ECONNREFUSED] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/econnreset.S b/libc/sysv/errfuns/econnreset.S index 515412cae..25c288444 100644 --- a/libc/sysv/errfuns/econnreset.S +++ b/libc/sysv/errfuns/econnreset.S @@ -9,7 +9,7 @@ econnreset: jmp __errfun #elif defined(__aarch64__) adrp x1,ECONNRESET - ldr w0,[x1,#:lo12:ECONNRESET] + ldrsw x0,[x1,#:lo12:ECONNRESET] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/edeadlk.S b/libc/sysv/errfuns/edeadlk.S index d5bec0502..afe0d4079 100644 --- a/libc/sysv/errfuns/edeadlk.S +++ b/libc/sysv/errfuns/edeadlk.S @@ -9,7 +9,7 @@ edeadlk: jmp __errfun #elif defined(__aarch64__) adrp x1,EDEADLK - ldr w0,[x1,#:lo12:EDEADLK] + ldrsw x0,[x1,#:lo12:EDEADLK] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/edestaddrreq.S b/libc/sysv/errfuns/edestaddrreq.S index a5a8e0d68..a0a5ab9cb 100644 --- a/libc/sysv/errfuns/edestaddrreq.S +++ b/libc/sysv/errfuns/edestaddrreq.S @@ -9,7 +9,7 @@ edestaddrreq: jmp __errfun #elif defined(__aarch64__) adrp x1,EDESTADDRREQ - ldr w0,[x1,#:lo12:EDESTADDRREQ] + ldrsw x0,[x1,#:lo12:EDESTADDRREQ] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/edom.S b/libc/sysv/errfuns/edom.S index 91b3ee442..8cd201eb2 100644 --- a/libc/sysv/errfuns/edom.S +++ b/libc/sysv/errfuns/edom.S @@ -9,7 +9,7 @@ edom: jmp __errfun #elif defined(__aarch64__) adrp x1,EDOM - ldr w0,[x1,#:lo12:EDOM] + ldrsw x0,[x1,#:lo12:EDOM] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/edotdot.S b/libc/sysv/errfuns/edotdot.S index 970ef2297..76639d868 100644 --- a/libc/sysv/errfuns/edotdot.S +++ b/libc/sysv/errfuns/edotdot.S @@ -9,7 +9,7 @@ edotdot: jmp __errfun #elif defined(__aarch64__) adrp x1,EDOTDOT - ldr w0,[x1,#:lo12:EDOTDOT] + ldrsw x0,[x1,#:lo12:EDOTDOT] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/edquot.S b/libc/sysv/errfuns/edquot.S index 0ea0d67a4..84c12a85c 100644 --- a/libc/sysv/errfuns/edquot.S +++ b/libc/sysv/errfuns/edquot.S @@ -9,7 +9,7 @@ edquot: jmp __errfun #elif defined(__aarch64__) adrp x1,EDQUOT - ldr w0,[x1,#:lo12:EDQUOT] + ldrsw x0,[x1,#:lo12:EDQUOT] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eexist.S b/libc/sysv/errfuns/eexist.S index e288c558c..4a81f63e6 100644 --- a/libc/sysv/errfuns/eexist.S +++ b/libc/sysv/errfuns/eexist.S @@ -9,7 +9,7 @@ eexist: jmp __errfun #elif defined(__aarch64__) adrp x1,EEXIST - ldr w0,[x1,#:lo12:EEXIST] + ldrsw x0,[x1,#:lo12:EEXIST] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/efault.S b/libc/sysv/errfuns/efault.S index 71df8d8bc..5ce7cfc9a 100644 --- a/libc/sysv/errfuns/efault.S +++ b/libc/sysv/errfuns/efault.S @@ -9,7 +9,7 @@ efault: jmp __errfun #elif defined(__aarch64__) adrp x1,EFAULT - ldr w0,[x1,#:lo12:EFAULT] + ldrsw x0,[x1,#:lo12:EFAULT] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/efbig.S b/libc/sysv/errfuns/efbig.S index 4d9e06549..5326e8392 100644 --- a/libc/sysv/errfuns/efbig.S +++ b/libc/sysv/errfuns/efbig.S @@ -9,7 +9,7 @@ efbig: jmp __errfun #elif defined(__aarch64__) adrp x1,EFBIG - ldr w0,[x1,#:lo12:EFBIG] + ldrsw x0,[x1,#:lo12:EFBIG] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/ehostdown.S b/libc/sysv/errfuns/ehostdown.S index c85a150fb..a57d3921c 100644 --- a/libc/sysv/errfuns/ehostdown.S +++ b/libc/sysv/errfuns/ehostdown.S @@ -9,7 +9,7 @@ ehostdown: jmp __errfun #elif defined(__aarch64__) adrp x1,EHOSTDOWN - ldr w0,[x1,#:lo12:EHOSTDOWN] + ldrsw x0,[x1,#:lo12:EHOSTDOWN] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/ehostunreach.S b/libc/sysv/errfuns/ehostunreach.S index 019016a1a..031051d88 100644 --- a/libc/sysv/errfuns/ehostunreach.S +++ b/libc/sysv/errfuns/ehostunreach.S @@ -9,7 +9,7 @@ ehostunreach: jmp __errfun #elif defined(__aarch64__) adrp x1,EHOSTUNREACH - ldr w0,[x1,#:lo12:EHOSTUNREACH] + ldrsw x0,[x1,#:lo12:EHOSTUNREACH] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/ehwpoison.S b/libc/sysv/errfuns/ehwpoison.S index f2d0de9d5..26ea95b75 100644 --- a/libc/sysv/errfuns/ehwpoison.S +++ b/libc/sysv/errfuns/ehwpoison.S @@ -9,7 +9,7 @@ ehwpoison: jmp __errfun #elif defined(__aarch64__) adrp x1,EHWPOISON - ldr w0,[x1,#:lo12:EHWPOISON] + ldrsw x0,[x1,#:lo12:EHWPOISON] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eidrm.S b/libc/sysv/errfuns/eidrm.S index beed86665..f0cceddad 100644 --- a/libc/sysv/errfuns/eidrm.S +++ b/libc/sysv/errfuns/eidrm.S @@ -9,7 +9,7 @@ eidrm: jmp __errfun #elif defined(__aarch64__) adrp x1,EIDRM - ldr w0,[x1,#:lo12:EIDRM] + ldrsw x0,[x1,#:lo12:EIDRM] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eilseq.S b/libc/sysv/errfuns/eilseq.S index 057872b38..a8623b805 100644 --- a/libc/sysv/errfuns/eilseq.S +++ b/libc/sysv/errfuns/eilseq.S @@ -9,7 +9,7 @@ eilseq: jmp __errfun #elif defined(__aarch64__) adrp x1,EILSEQ - ldr w0,[x1,#:lo12:EILSEQ] + ldrsw x0,[x1,#:lo12:EILSEQ] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/einprogress.S b/libc/sysv/errfuns/einprogress.S index 85cf46e4f..c99ce0da1 100644 --- a/libc/sysv/errfuns/einprogress.S +++ b/libc/sysv/errfuns/einprogress.S @@ -9,7 +9,7 @@ einprogress: jmp __errfun #elif defined(__aarch64__) adrp x1,EINPROGRESS - ldr w0,[x1,#:lo12:EINPROGRESS] + ldrsw x0,[x1,#:lo12:EINPROGRESS] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eintr.S b/libc/sysv/errfuns/eintr.S index f4b992402..6bf106a31 100644 --- a/libc/sysv/errfuns/eintr.S +++ b/libc/sysv/errfuns/eintr.S @@ -9,7 +9,7 @@ eintr: jmp __errfun #elif defined(__aarch64__) adrp x1,EINTR - ldr w0,[x1,#:lo12:EINTR] + ldrsw x0,[x1,#:lo12:EINTR] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/einval.S b/libc/sysv/errfuns/einval.S index 4710e00fa..d98320575 100644 --- a/libc/sysv/errfuns/einval.S +++ b/libc/sysv/errfuns/einval.S @@ -9,7 +9,7 @@ einval: jmp __errfun #elif defined(__aarch64__) adrp x1,EINVAL - ldr w0,[x1,#:lo12:EINVAL] + ldrsw x0,[x1,#:lo12:EINVAL] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eio.S b/libc/sysv/errfuns/eio.S index 85c572997..65805237d 100644 --- a/libc/sysv/errfuns/eio.S +++ b/libc/sysv/errfuns/eio.S @@ -9,7 +9,7 @@ eio: jmp __errfun #elif defined(__aarch64__) adrp x1,EIO - ldr w0,[x1,#:lo12:EIO] + ldrsw x0,[x1,#:lo12:EIO] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eisconn.S b/libc/sysv/errfuns/eisconn.S index 312194b3e..1635b8858 100644 --- a/libc/sysv/errfuns/eisconn.S +++ b/libc/sysv/errfuns/eisconn.S @@ -9,7 +9,7 @@ eisconn: jmp __errfun #elif defined(__aarch64__) adrp x1,EISCONN - ldr w0,[x1,#:lo12:EISCONN] + ldrsw x0,[x1,#:lo12:EISCONN] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eisdir.S b/libc/sysv/errfuns/eisdir.S index 96998f79d..5d2f8ad72 100644 --- a/libc/sysv/errfuns/eisdir.S +++ b/libc/sysv/errfuns/eisdir.S @@ -9,7 +9,7 @@ eisdir: jmp __errfun #elif defined(__aarch64__) adrp x1,EISDIR - ldr w0,[x1,#:lo12:EISDIR] + ldrsw x0,[x1,#:lo12:EISDIR] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eisnam.S b/libc/sysv/errfuns/eisnam.S index 6828a9062..87c3e74c4 100644 --- a/libc/sysv/errfuns/eisnam.S +++ b/libc/sysv/errfuns/eisnam.S @@ -9,7 +9,7 @@ eisnam: jmp __errfun #elif defined(__aarch64__) adrp x1,EISNAM - ldr w0,[x1,#:lo12:EISNAM] + ldrsw x0,[x1,#:lo12:EISNAM] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/ekeyexpired.S b/libc/sysv/errfuns/ekeyexpired.S index 8fcece1a9..58ee6a832 100644 --- a/libc/sysv/errfuns/ekeyexpired.S +++ b/libc/sysv/errfuns/ekeyexpired.S @@ -9,7 +9,7 @@ ekeyexpired: jmp __errfun #elif defined(__aarch64__) adrp x1,EKEYEXPIRED - ldr w0,[x1,#:lo12:EKEYEXPIRED] + ldrsw x0,[x1,#:lo12:EKEYEXPIRED] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/ekeyrejected.S b/libc/sysv/errfuns/ekeyrejected.S index bde714cff..c9e589c60 100644 --- a/libc/sysv/errfuns/ekeyrejected.S +++ b/libc/sysv/errfuns/ekeyrejected.S @@ -9,7 +9,7 @@ ekeyrejected: jmp __errfun #elif defined(__aarch64__) adrp x1,EKEYREJECTED - ldr w0,[x1,#:lo12:EKEYREJECTED] + ldrsw x0,[x1,#:lo12:EKEYREJECTED] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/ekeyrevoked.S b/libc/sysv/errfuns/ekeyrevoked.S index daf047007..96fad68ef 100644 --- a/libc/sysv/errfuns/ekeyrevoked.S +++ b/libc/sysv/errfuns/ekeyrevoked.S @@ -9,7 +9,7 @@ ekeyrevoked: jmp __errfun #elif defined(__aarch64__) adrp x1,EKEYREVOKED - ldr w0,[x1,#:lo12:EKEYREVOKED] + ldrsw x0,[x1,#:lo12:EKEYREVOKED] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/el2hlt.S b/libc/sysv/errfuns/el2hlt.S index 11dd13de3..9b6b4d19c 100644 --- a/libc/sysv/errfuns/el2hlt.S +++ b/libc/sysv/errfuns/el2hlt.S @@ -9,7 +9,7 @@ el2hlt: jmp __errfun #elif defined(__aarch64__) adrp x1,EL2HLT - ldr w0,[x1,#:lo12:EL2HLT] + ldrsw x0,[x1,#:lo12:EL2HLT] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/el2nsync.S b/libc/sysv/errfuns/el2nsync.S index c40649d03..1ceffcbe2 100644 --- a/libc/sysv/errfuns/el2nsync.S +++ b/libc/sysv/errfuns/el2nsync.S @@ -9,7 +9,7 @@ el2nsync: jmp __errfun #elif defined(__aarch64__) adrp x1,EL2NSYNC - ldr w0,[x1,#:lo12:EL2NSYNC] + ldrsw x0,[x1,#:lo12:EL2NSYNC] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/el3hlt.S b/libc/sysv/errfuns/el3hlt.S index d35eb7e24..5300ffc5b 100644 --- a/libc/sysv/errfuns/el3hlt.S +++ b/libc/sysv/errfuns/el3hlt.S @@ -9,7 +9,7 @@ el3hlt: jmp __errfun #elif defined(__aarch64__) adrp x1,EL3HLT - ldr w0,[x1,#:lo12:EL3HLT] + ldrsw x0,[x1,#:lo12:EL3HLT] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/el3rst.S b/libc/sysv/errfuns/el3rst.S index 053583085..12dc3c4ab 100644 --- a/libc/sysv/errfuns/el3rst.S +++ b/libc/sysv/errfuns/el3rst.S @@ -9,7 +9,7 @@ el3rst: jmp __errfun #elif defined(__aarch64__) adrp x1,EL3RST - ldr w0,[x1,#:lo12:EL3RST] + ldrsw x0,[x1,#:lo12:EL3RST] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/elibacc.S b/libc/sysv/errfuns/elibacc.S index f07158299..4e856b961 100644 --- a/libc/sysv/errfuns/elibacc.S +++ b/libc/sysv/errfuns/elibacc.S @@ -9,7 +9,7 @@ elibacc: jmp __errfun #elif defined(__aarch64__) adrp x1,ELIBACC - ldr w0,[x1,#:lo12:ELIBACC] + ldrsw x0,[x1,#:lo12:ELIBACC] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/elibbad.S b/libc/sysv/errfuns/elibbad.S index 045b9947d..4e933c43c 100644 --- a/libc/sysv/errfuns/elibbad.S +++ b/libc/sysv/errfuns/elibbad.S @@ -9,7 +9,7 @@ elibbad: jmp __errfun #elif defined(__aarch64__) adrp x1,ELIBBAD - ldr w0,[x1,#:lo12:ELIBBAD] + ldrsw x0,[x1,#:lo12:ELIBBAD] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/elibexec.S b/libc/sysv/errfuns/elibexec.S index 0a36ed029..d12efe9b5 100644 --- a/libc/sysv/errfuns/elibexec.S +++ b/libc/sysv/errfuns/elibexec.S @@ -9,7 +9,7 @@ elibexec: jmp __errfun #elif defined(__aarch64__) adrp x1,ELIBEXEC - ldr w0,[x1,#:lo12:ELIBEXEC] + ldrsw x0,[x1,#:lo12:ELIBEXEC] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/elibmax.S b/libc/sysv/errfuns/elibmax.S index e95d4d16b..b1bc56d8b 100644 --- a/libc/sysv/errfuns/elibmax.S +++ b/libc/sysv/errfuns/elibmax.S @@ -9,7 +9,7 @@ elibmax: jmp __errfun #elif defined(__aarch64__) adrp x1,ELIBMAX - ldr w0,[x1,#:lo12:ELIBMAX] + ldrsw x0,[x1,#:lo12:ELIBMAX] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/elibscn.S b/libc/sysv/errfuns/elibscn.S index 0917a6d47..62f783e21 100644 --- a/libc/sysv/errfuns/elibscn.S +++ b/libc/sysv/errfuns/elibscn.S @@ -9,7 +9,7 @@ elibscn: jmp __errfun #elif defined(__aarch64__) adrp x1,ELIBSCN - ldr w0,[x1,#:lo12:ELIBSCN] + ldrsw x0,[x1,#:lo12:ELIBSCN] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/elnrng.S b/libc/sysv/errfuns/elnrng.S index fc5ba7e50..82de694ed 100644 --- a/libc/sysv/errfuns/elnrng.S +++ b/libc/sysv/errfuns/elnrng.S @@ -9,7 +9,7 @@ elnrng: jmp __errfun #elif defined(__aarch64__) adrp x1,ELNRNG - ldr w0,[x1,#:lo12:ELNRNG] + ldrsw x0,[x1,#:lo12:ELNRNG] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eloop.S b/libc/sysv/errfuns/eloop.S index 0e9cab58c..2d4b9f6db 100644 --- a/libc/sysv/errfuns/eloop.S +++ b/libc/sysv/errfuns/eloop.S @@ -9,7 +9,7 @@ eloop: jmp __errfun #elif defined(__aarch64__) adrp x1,ELOOP - ldr w0,[x1,#:lo12:ELOOP] + ldrsw x0,[x1,#:lo12:ELOOP] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/emediumtype.S b/libc/sysv/errfuns/emediumtype.S index 1fc2f8f07..10d5b477c 100644 --- a/libc/sysv/errfuns/emediumtype.S +++ b/libc/sysv/errfuns/emediumtype.S @@ -9,7 +9,7 @@ emediumtype: jmp __errfun #elif defined(__aarch64__) adrp x1,EMEDIUMTYPE - ldr w0,[x1,#:lo12:EMEDIUMTYPE] + ldrsw x0,[x1,#:lo12:EMEDIUMTYPE] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/emfile.S b/libc/sysv/errfuns/emfile.S index 89c517325..ebd1d9535 100644 --- a/libc/sysv/errfuns/emfile.S +++ b/libc/sysv/errfuns/emfile.S @@ -9,7 +9,7 @@ emfile: jmp __errfun #elif defined(__aarch64__) adrp x1,EMFILE - ldr w0,[x1,#:lo12:EMFILE] + ldrsw x0,[x1,#:lo12:EMFILE] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/emlink.S b/libc/sysv/errfuns/emlink.S index 8b75e0772..a6de73a9d 100644 --- a/libc/sysv/errfuns/emlink.S +++ b/libc/sysv/errfuns/emlink.S @@ -9,7 +9,7 @@ emlink: jmp __errfun #elif defined(__aarch64__) adrp x1,EMLINK - ldr w0,[x1,#:lo12:EMLINK] + ldrsw x0,[x1,#:lo12:EMLINK] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/emsgsize.S b/libc/sysv/errfuns/emsgsize.S index 94b08ddef..aed2a305d 100644 --- a/libc/sysv/errfuns/emsgsize.S +++ b/libc/sysv/errfuns/emsgsize.S @@ -9,7 +9,7 @@ emsgsize: jmp __errfun #elif defined(__aarch64__) adrp x1,EMSGSIZE - ldr w0,[x1,#:lo12:EMSGSIZE] + ldrsw x0,[x1,#:lo12:EMSGSIZE] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/emultihop.S b/libc/sysv/errfuns/emultihop.S index 7163133bf..4ea9303af 100644 --- a/libc/sysv/errfuns/emultihop.S +++ b/libc/sysv/errfuns/emultihop.S @@ -9,7 +9,7 @@ emultihop: jmp __errfun #elif defined(__aarch64__) adrp x1,EMULTIHOP - ldr w0,[x1,#:lo12:EMULTIHOP] + ldrsw x0,[x1,#:lo12:EMULTIHOP] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enametoolong.S b/libc/sysv/errfuns/enametoolong.S index 4a3a06350..77918516a 100644 --- a/libc/sysv/errfuns/enametoolong.S +++ b/libc/sysv/errfuns/enametoolong.S @@ -9,7 +9,7 @@ enametoolong: jmp __errfun #elif defined(__aarch64__) adrp x1,ENAMETOOLONG - ldr w0,[x1,#:lo12:ENAMETOOLONG] + ldrsw x0,[x1,#:lo12:ENAMETOOLONG] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enavail.S b/libc/sysv/errfuns/enavail.S index 02e1bb3c4..05f1dc1de 100644 --- a/libc/sysv/errfuns/enavail.S +++ b/libc/sysv/errfuns/enavail.S @@ -9,7 +9,7 @@ enavail: jmp __errfun #elif defined(__aarch64__) adrp x1,ENAVAIL - ldr w0,[x1,#:lo12:ENAVAIL] + ldrsw x0,[x1,#:lo12:ENAVAIL] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enetdown.S b/libc/sysv/errfuns/enetdown.S index 31d41ba1c..ce94bef35 100644 --- a/libc/sysv/errfuns/enetdown.S +++ b/libc/sysv/errfuns/enetdown.S @@ -9,7 +9,7 @@ enetdown: jmp __errfun #elif defined(__aarch64__) adrp x1,ENETDOWN - ldr w0,[x1,#:lo12:ENETDOWN] + ldrsw x0,[x1,#:lo12:ENETDOWN] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enetreset.S b/libc/sysv/errfuns/enetreset.S index abcc7e723..cae447be1 100644 --- a/libc/sysv/errfuns/enetreset.S +++ b/libc/sysv/errfuns/enetreset.S @@ -9,7 +9,7 @@ enetreset: jmp __errfun #elif defined(__aarch64__) adrp x1,ENETRESET - ldr w0,[x1,#:lo12:ENETRESET] + ldrsw x0,[x1,#:lo12:ENETRESET] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enetunreach.S b/libc/sysv/errfuns/enetunreach.S index 68a75beaf..e2a1e3619 100644 --- a/libc/sysv/errfuns/enetunreach.S +++ b/libc/sysv/errfuns/enetunreach.S @@ -9,7 +9,7 @@ enetunreach: jmp __errfun #elif defined(__aarch64__) adrp x1,ENETUNREACH - ldr w0,[x1,#:lo12:ENETUNREACH] + ldrsw x0,[x1,#:lo12:ENETUNREACH] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enfile.S b/libc/sysv/errfuns/enfile.S index 428b87d0e..f67d0d043 100644 --- a/libc/sysv/errfuns/enfile.S +++ b/libc/sysv/errfuns/enfile.S @@ -9,7 +9,7 @@ enfile: jmp __errfun #elif defined(__aarch64__) adrp x1,ENFILE - ldr w0,[x1,#:lo12:ENFILE] + ldrsw x0,[x1,#:lo12:ENFILE] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enoano.S b/libc/sysv/errfuns/enoano.S index e4e9800f5..ee5fe4f27 100644 --- a/libc/sysv/errfuns/enoano.S +++ b/libc/sysv/errfuns/enoano.S @@ -9,7 +9,7 @@ enoano: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOANO - ldr w0,[x1,#:lo12:ENOANO] + ldrsw x0,[x1,#:lo12:ENOANO] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enobufs.S b/libc/sysv/errfuns/enobufs.S index e2f38af63..e1a559917 100644 --- a/libc/sysv/errfuns/enobufs.S +++ b/libc/sysv/errfuns/enobufs.S @@ -9,7 +9,7 @@ enobufs: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOBUFS - ldr w0,[x1,#:lo12:ENOBUFS] + ldrsw x0,[x1,#:lo12:ENOBUFS] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enocsi.S b/libc/sysv/errfuns/enocsi.S index 8854c48ff..d0a985a42 100644 --- a/libc/sysv/errfuns/enocsi.S +++ b/libc/sysv/errfuns/enocsi.S @@ -9,7 +9,7 @@ enocsi: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOCSI - ldr w0,[x1,#:lo12:ENOCSI] + ldrsw x0,[x1,#:lo12:ENOCSI] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enodata.S b/libc/sysv/errfuns/enodata.S index e2a6e1796..eecb6c5e0 100644 --- a/libc/sysv/errfuns/enodata.S +++ b/libc/sysv/errfuns/enodata.S @@ -9,7 +9,7 @@ enodata: jmp __errfun #elif defined(__aarch64__) adrp x1,ENODATA - ldr w0,[x1,#:lo12:ENODATA] + ldrsw x0,[x1,#:lo12:ENODATA] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enodev.S b/libc/sysv/errfuns/enodev.S index 45bc25dbc..990597d9d 100644 --- a/libc/sysv/errfuns/enodev.S +++ b/libc/sysv/errfuns/enodev.S @@ -9,7 +9,7 @@ enodev: jmp __errfun #elif defined(__aarch64__) adrp x1,ENODEV - ldr w0,[x1,#:lo12:ENODEV] + ldrsw x0,[x1,#:lo12:ENODEV] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enoent.S b/libc/sysv/errfuns/enoent.S index 18ad32acb..3d6fdaac4 100644 --- a/libc/sysv/errfuns/enoent.S +++ b/libc/sysv/errfuns/enoent.S @@ -9,7 +9,7 @@ enoent: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOENT - ldr w0,[x1,#:lo12:ENOENT] + ldrsw x0,[x1,#:lo12:ENOENT] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enoexec.S b/libc/sysv/errfuns/enoexec.S index a7ff8267a..5901facff 100644 --- a/libc/sysv/errfuns/enoexec.S +++ b/libc/sysv/errfuns/enoexec.S @@ -9,7 +9,7 @@ enoexec: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOEXEC - ldr w0,[x1,#:lo12:ENOEXEC] + ldrsw x0,[x1,#:lo12:ENOEXEC] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enokey.S b/libc/sysv/errfuns/enokey.S index 7f4200c85..c387526b5 100644 --- a/libc/sysv/errfuns/enokey.S +++ b/libc/sysv/errfuns/enokey.S @@ -9,7 +9,7 @@ enokey: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOKEY - ldr w0,[x1,#:lo12:ENOKEY] + ldrsw x0,[x1,#:lo12:ENOKEY] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enolck.S b/libc/sysv/errfuns/enolck.S index 8cdac9e13..ac26cda1e 100644 --- a/libc/sysv/errfuns/enolck.S +++ b/libc/sysv/errfuns/enolck.S @@ -9,7 +9,7 @@ enolck: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOLCK - ldr w0,[x1,#:lo12:ENOLCK] + ldrsw x0,[x1,#:lo12:ENOLCK] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enolink.S b/libc/sysv/errfuns/enolink.S index d1a2d3f49..114e649a4 100644 --- a/libc/sysv/errfuns/enolink.S +++ b/libc/sysv/errfuns/enolink.S @@ -9,7 +9,7 @@ enolink: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOLINK - ldr w0,[x1,#:lo12:ENOLINK] + ldrsw x0,[x1,#:lo12:ENOLINK] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enomedium.S b/libc/sysv/errfuns/enomedium.S index c00208124..5beff7380 100644 --- a/libc/sysv/errfuns/enomedium.S +++ b/libc/sysv/errfuns/enomedium.S @@ -9,7 +9,7 @@ enomedium: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOMEDIUM - ldr w0,[x1,#:lo12:ENOMEDIUM] + ldrsw x0,[x1,#:lo12:ENOMEDIUM] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enomem.S b/libc/sysv/errfuns/enomem.S index fdbacd5ca..85ffc0a77 100644 --- a/libc/sysv/errfuns/enomem.S +++ b/libc/sysv/errfuns/enomem.S @@ -9,7 +9,7 @@ enomem: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOMEM - ldr w0,[x1,#:lo12:ENOMEM] + ldrsw x0,[x1,#:lo12:ENOMEM] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enomsg.S b/libc/sysv/errfuns/enomsg.S index cc026e0d3..fac5e5439 100644 --- a/libc/sysv/errfuns/enomsg.S +++ b/libc/sysv/errfuns/enomsg.S @@ -9,7 +9,7 @@ enomsg: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOMSG - ldr w0,[x1,#:lo12:ENOMSG] + ldrsw x0,[x1,#:lo12:ENOMSG] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enonet.S b/libc/sysv/errfuns/enonet.S index 337e3302d..ae755f97e 100644 --- a/libc/sysv/errfuns/enonet.S +++ b/libc/sysv/errfuns/enonet.S @@ -9,7 +9,7 @@ enonet: jmp __errfun #elif defined(__aarch64__) adrp x1,ENONET - ldr w0,[x1,#:lo12:ENONET] + ldrsw x0,[x1,#:lo12:ENONET] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enopkg.S b/libc/sysv/errfuns/enopkg.S index 53dfbefe0..78c7c60a7 100644 --- a/libc/sysv/errfuns/enopkg.S +++ b/libc/sysv/errfuns/enopkg.S @@ -9,7 +9,7 @@ enopkg: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOPKG - ldr w0,[x1,#:lo12:ENOPKG] + ldrsw x0,[x1,#:lo12:ENOPKG] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enoprotoopt.S b/libc/sysv/errfuns/enoprotoopt.S index 96bbe3a80..164344c14 100644 --- a/libc/sysv/errfuns/enoprotoopt.S +++ b/libc/sysv/errfuns/enoprotoopt.S @@ -9,7 +9,7 @@ enoprotoopt: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOPROTOOPT - ldr w0,[x1,#:lo12:ENOPROTOOPT] + ldrsw x0,[x1,#:lo12:ENOPROTOOPT] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enospc.S b/libc/sysv/errfuns/enospc.S index 2d0d18120..019c925d4 100644 --- a/libc/sysv/errfuns/enospc.S +++ b/libc/sysv/errfuns/enospc.S @@ -9,7 +9,7 @@ enospc: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOSPC - ldr w0,[x1,#:lo12:ENOSPC] + ldrsw x0,[x1,#:lo12:ENOSPC] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enosr.S b/libc/sysv/errfuns/enosr.S index 2415c09d4..d0a145a51 100644 --- a/libc/sysv/errfuns/enosr.S +++ b/libc/sysv/errfuns/enosr.S @@ -9,7 +9,7 @@ enosr: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOSR - ldr w0,[x1,#:lo12:ENOSR] + ldrsw x0,[x1,#:lo12:ENOSR] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enostr.S b/libc/sysv/errfuns/enostr.S index a4cfda20a..59c4f1bb4 100644 --- a/libc/sysv/errfuns/enostr.S +++ b/libc/sysv/errfuns/enostr.S @@ -9,7 +9,7 @@ enostr: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOSTR - ldr w0,[x1,#:lo12:ENOSTR] + ldrsw x0,[x1,#:lo12:ENOSTR] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enosys.S b/libc/sysv/errfuns/enosys.S index d031c1def..82d91d533 100644 --- a/libc/sysv/errfuns/enosys.S +++ b/libc/sysv/errfuns/enosys.S @@ -9,7 +9,7 @@ enosys: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOSYS - ldr w0,[x1,#:lo12:ENOSYS] + ldrsw x0,[x1,#:lo12:ENOSYS] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enotblk.S b/libc/sysv/errfuns/enotblk.S index e4cd5aa1a..744329526 100644 --- a/libc/sysv/errfuns/enotblk.S +++ b/libc/sysv/errfuns/enotblk.S @@ -9,7 +9,7 @@ enotblk: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOTBLK - ldr w0,[x1,#:lo12:ENOTBLK] + ldrsw x0,[x1,#:lo12:ENOTBLK] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enotconn.S b/libc/sysv/errfuns/enotconn.S index 1bc3e25b1..de34411ef 100644 --- a/libc/sysv/errfuns/enotconn.S +++ b/libc/sysv/errfuns/enotconn.S @@ -9,7 +9,7 @@ enotconn: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOTCONN - ldr w0,[x1,#:lo12:ENOTCONN] + ldrsw x0,[x1,#:lo12:ENOTCONN] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enotdir.S b/libc/sysv/errfuns/enotdir.S index 79becc250..81bd1359e 100644 --- a/libc/sysv/errfuns/enotdir.S +++ b/libc/sysv/errfuns/enotdir.S @@ -9,7 +9,7 @@ enotdir: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOTDIR - ldr w0,[x1,#:lo12:ENOTDIR] + ldrsw x0,[x1,#:lo12:ENOTDIR] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enotempty.S b/libc/sysv/errfuns/enotempty.S index cccd97c8b..84215d914 100644 --- a/libc/sysv/errfuns/enotempty.S +++ b/libc/sysv/errfuns/enotempty.S @@ -9,7 +9,7 @@ enotempty: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOTEMPTY - ldr w0,[x1,#:lo12:ENOTEMPTY] + ldrsw x0,[x1,#:lo12:ENOTEMPTY] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enotnam.S b/libc/sysv/errfuns/enotnam.S index c964076da..23a82028d 100644 --- a/libc/sysv/errfuns/enotnam.S +++ b/libc/sysv/errfuns/enotnam.S @@ -9,7 +9,7 @@ enotnam: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOTNAM - ldr w0,[x1,#:lo12:ENOTNAM] + ldrsw x0,[x1,#:lo12:ENOTNAM] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enotrecoverable.S b/libc/sysv/errfuns/enotrecoverable.S index e19d105b6..3d0aa5772 100644 --- a/libc/sysv/errfuns/enotrecoverable.S +++ b/libc/sysv/errfuns/enotrecoverable.S @@ -9,7 +9,7 @@ enotrecoverable: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOTRECOVERABLE - ldr w0,[x1,#:lo12:ENOTRECOVERABLE] + ldrsw x0,[x1,#:lo12:ENOTRECOVERABLE] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enotsock.S b/libc/sysv/errfuns/enotsock.S index cd5c4401e..9826d2a17 100644 --- a/libc/sysv/errfuns/enotsock.S +++ b/libc/sysv/errfuns/enotsock.S @@ -9,7 +9,7 @@ enotsock: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOTSOCK - ldr w0,[x1,#:lo12:ENOTSOCK] + ldrsw x0,[x1,#:lo12:ENOTSOCK] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enotsup.S b/libc/sysv/errfuns/enotsup.S index 63e8d4310..7133bb285 100644 --- a/libc/sysv/errfuns/enotsup.S +++ b/libc/sysv/errfuns/enotsup.S @@ -9,7 +9,7 @@ enotsup: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOTSUP - ldr w0,[x1,#:lo12:ENOTSUP] + ldrsw x0,[x1,#:lo12:ENOTSUP] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enotty.S b/libc/sysv/errfuns/enotty.S index 80a06a897..bd66b8c3d 100644 --- a/libc/sysv/errfuns/enotty.S +++ b/libc/sysv/errfuns/enotty.S @@ -9,7 +9,7 @@ enotty: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOTTY - ldr w0,[x1,#:lo12:ENOTTY] + ldrsw x0,[x1,#:lo12:ENOTTY] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enotuniq.S b/libc/sysv/errfuns/enotuniq.S index 1aa829100..9c5080872 100644 --- a/libc/sysv/errfuns/enotuniq.S +++ b/libc/sysv/errfuns/enotuniq.S @@ -9,7 +9,7 @@ enotuniq: jmp __errfun #elif defined(__aarch64__) adrp x1,ENOTUNIQ - ldr w0,[x1,#:lo12:ENOTUNIQ] + ldrsw x0,[x1,#:lo12:ENOTUNIQ] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/enxio.S b/libc/sysv/errfuns/enxio.S index f04e8e3ce..c21d6cf6b 100644 --- a/libc/sysv/errfuns/enxio.S +++ b/libc/sysv/errfuns/enxio.S @@ -9,7 +9,7 @@ enxio: jmp __errfun #elif defined(__aarch64__) adrp x1,ENXIO - ldr w0,[x1,#:lo12:ENXIO] + ldrsw x0,[x1,#:lo12:ENXIO] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eopnotsupp.S b/libc/sysv/errfuns/eopnotsupp.S index 7b718fea4..95bfc35b5 100644 --- a/libc/sysv/errfuns/eopnotsupp.S +++ b/libc/sysv/errfuns/eopnotsupp.S @@ -9,7 +9,7 @@ eopnotsupp: jmp __errfun #elif defined(__aarch64__) adrp x1,EOPNOTSUPP - ldr w0,[x1,#:lo12:EOPNOTSUPP] + ldrsw x0,[x1,#:lo12:EOPNOTSUPP] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eoverflow.S b/libc/sysv/errfuns/eoverflow.S index 9447ae3cd..c52f142b9 100644 --- a/libc/sysv/errfuns/eoverflow.S +++ b/libc/sysv/errfuns/eoverflow.S @@ -9,7 +9,7 @@ eoverflow: jmp __errfun #elif defined(__aarch64__) adrp x1,EOVERFLOW - ldr w0,[x1,#:lo12:EOVERFLOW] + ldrsw x0,[x1,#:lo12:EOVERFLOW] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eownerdead.S b/libc/sysv/errfuns/eownerdead.S index b30821460..4549b2257 100644 --- a/libc/sysv/errfuns/eownerdead.S +++ b/libc/sysv/errfuns/eownerdead.S @@ -9,7 +9,7 @@ eownerdead: jmp __errfun #elif defined(__aarch64__) adrp x1,EOWNERDEAD - ldr w0,[x1,#:lo12:EOWNERDEAD] + ldrsw x0,[x1,#:lo12:EOWNERDEAD] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eperm.S b/libc/sysv/errfuns/eperm.S index 6dceaabaf..101a2052d 100644 --- a/libc/sysv/errfuns/eperm.S +++ b/libc/sysv/errfuns/eperm.S @@ -9,7 +9,7 @@ eperm: jmp __errfun #elif defined(__aarch64__) adrp x1,EPERM - ldr w0,[x1,#:lo12:EPERM] + ldrsw x0,[x1,#:lo12:EPERM] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/epfnosupport.S b/libc/sysv/errfuns/epfnosupport.S index 88086096e..979fe71ce 100644 --- a/libc/sysv/errfuns/epfnosupport.S +++ b/libc/sysv/errfuns/epfnosupport.S @@ -9,7 +9,7 @@ epfnosupport: jmp __errfun #elif defined(__aarch64__) adrp x1,EPFNOSUPPORT - ldr w0,[x1,#:lo12:EPFNOSUPPORT] + ldrsw x0,[x1,#:lo12:EPFNOSUPPORT] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/epipe.S b/libc/sysv/errfuns/epipe.S index 0dc40b485..197a1cf64 100644 --- a/libc/sysv/errfuns/epipe.S +++ b/libc/sysv/errfuns/epipe.S @@ -9,7 +9,7 @@ epipe: jmp __errfun #elif defined(__aarch64__) adrp x1,EPIPE - ldr w0,[x1,#:lo12:EPIPE] + ldrsw x0,[x1,#:lo12:EPIPE] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eproto.S b/libc/sysv/errfuns/eproto.S index a77cd96c0..5436c6830 100644 --- a/libc/sysv/errfuns/eproto.S +++ b/libc/sysv/errfuns/eproto.S @@ -9,7 +9,7 @@ eproto: jmp __errfun #elif defined(__aarch64__) adrp x1,EPROTO - ldr w0,[x1,#:lo12:EPROTO] + ldrsw x0,[x1,#:lo12:EPROTO] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eprotonosupport.S b/libc/sysv/errfuns/eprotonosupport.S index 6ecabaeda..64c578001 100644 --- a/libc/sysv/errfuns/eprotonosupport.S +++ b/libc/sysv/errfuns/eprotonosupport.S @@ -9,7 +9,7 @@ eprotonosupport: jmp __errfun #elif defined(__aarch64__) adrp x1,EPROTONOSUPPORT - ldr w0,[x1,#:lo12:EPROTONOSUPPORT] + ldrsw x0,[x1,#:lo12:EPROTONOSUPPORT] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eprototype.S b/libc/sysv/errfuns/eprototype.S index 152e63798..a470f315a 100644 --- a/libc/sysv/errfuns/eprototype.S +++ b/libc/sysv/errfuns/eprototype.S @@ -9,7 +9,7 @@ eprototype: jmp __errfun #elif defined(__aarch64__) adrp x1,EPROTOTYPE - ldr w0,[x1,#:lo12:EPROTOTYPE] + ldrsw x0,[x1,#:lo12:EPROTOTYPE] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/erange.S b/libc/sysv/errfuns/erange.S index 02fa26a6d..3a3c1ca29 100644 --- a/libc/sysv/errfuns/erange.S +++ b/libc/sysv/errfuns/erange.S @@ -9,7 +9,7 @@ erange: jmp __errfun #elif defined(__aarch64__) adrp x1,ERANGE - ldr w0,[x1,#:lo12:ERANGE] + ldrsw x0,[x1,#:lo12:ERANGE] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eremchg.S b/libc/sysv/errfuns/eremchg.S index 0af873791..be644bf71 100644 --- a/libc/sysv/errfuns/eremchg.S +++ b/libc/sysv/errfuns/eremchg.S @@ -9,7 +9,7 @@ eremchg: jmp __errfun #elif defined(__aarch64__) adrp x1,EREMCHG - ldr w0,[x1,#:lo12:EREMCHG] + ldrsw x0,[x1,#:lo12:EREMCHG] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eremote.S b/libc/sysv/errfuns/eremote.S index 472cd9ca1..20dfb61c1 100644 --- a/libc/sysv/errfuns/eremote.S +++ b/libc/sysv/errfuns/eremote.S @@ -9,7 +9,7 @@ eremote: jmp __errfun #elif defined(__aarch64__) adrp x1,EREMOTE - ldr w0,[x1,#:lo12:EREMOTE] + ldrsw x0,[x1,#:lo12:EREMOTE] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eremoteio.S b/libc/sysv/errfuns/eremoteio.S index 908500d1b..e08da6e1c 100644 --- a/libc/sysv/errfuns/eremoteio.S +++ b/libc/sysv/errfuns/eremoteio.S @@ -9,7 +9,7 @@ eremoteio: jmp __errfun #elif defined(__aarch64__) adrp x1,EREMOTEIO - ldr w0,[x1,#:lo12:EREMOTEIO] + ldrsw x0,[x1,#:lo12:EREMOTEIO] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/erestart.S b/libc/sysv/errfuns/erestart.S index bd8fcb00d..f3fa1aecf 100644 --- a/libc/sysv/errfuns/erestart.S +++ b/libc/sysv/errfuns/erestart.S @@ -9,7 +9,7 @@ erestart: jmp __errfun #elif defined(__aarch64__) adrp x1,ERESTART - ldr w0,[x1,#:lo12:ERESTART] + ldrsw x0,[x1,#:lo12:ERESTART] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/erfkill.S b/libc/sysv/errfuns/erfkill.S index c40a00785..6e4f72cf1 100644 --- a/libc/sysv/errfuns/erfkill.S +++ b/libc/sysv/errfuns/erfkill.S @@ -9,7 +9,7 @@ erfkill: jmp __errfun #elif defined(__aarch64__) adrp x1,ERFKILL - ldr w0,[x1,#:lo12:ERFKILL] + ldrsw x0,[x1,#:lo12:ERFKILL] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/erofs.S b/libc/sysv/errfuns/erofs.S index 56f8c7e8a..e074430d3 100644 --- a/libc/sysv/errfuns/erofs.S +++ b/libc/sysv/errfuns/erofs.S @@ -9,7 +9,7 @@ erofs: jmp __errfun #elif defined(__aarch64__) adrp x1,EROFS - ldr w0,[x1,#:lo12:EROFS] + ldrsw x0,[x1,#:lo12:EROFS] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eshutdown.S b/libc/sysv/errfuns/eshutdown.S index 495eccd22..f0e734c2a 100644 --- a/libc/sysv/errfuns/eshutdown.S +++ b/libc/sysv/errfuns/eshutdown.S @@ -9,7 +9,7 @@ eshutdown: jmp __errfun #elif defined(__aarch64__) adrp x1,ESHUTDOWN - ldr w0,[x1,#:lo12:ESHUTDOWN] + ldrsw x0,[x1,#:lo12:ESHUTDOWN] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/esocktnosupport.S b/libc/sysv/errfuns/esocktnosupport.S index f1ebae34b..46b083aae 100644 --- a/libc/sysv/errfuns/esocktnosupport.S +++ b/libc/sysv/errfuns/esocktnosupport.S @@ -9,7 +9,7 @@ esocktnosupport: jmp __errfun #elif defined(__aarch64__) adrp x1,ESOCKTNOSUPPORT - ldr w0,[x1,#:lo12:ESOCKTNOSUPPORT] + ldrsw x0,[x1,#:lo12:ESOCKTNOSUPPORT] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/espipe.S b/libc/sysv/errfuns/espipe.S index 3b518840d..8eb6f1ebf 100644 --- a/libc/sysv/errfuns/espipe.S +++ b/libc/sysv/errfuns/espipe.S @@ -9,7 +9,7 @@ espipe: jmp __errfun #elif defined(__aarch64__) adrp x1,ESPIPE - ldr w0,[x1,#:lo12:ESPIPE] + ldrsw x0,[x1,#:lo12:ESPIPE] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/esrch.S b/libc/sysv/errfuns/esrch.S index f9d38c70d..cc3b68d77 100644 --- a/libc/sysv/errfuns/esrch.S +++ b/libc/sysv/errfuns/esrch.S @@ -9,7 +9,7 @@ esrch: jmp __errfun #elif defined(__aarch64__) adrp x1,ESRCH - ldr w0,[x1,#:lo12:ESRCH] + ldrsw x0,[x1,#:lo12:ESRCH] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/esrmnt.S b/libc/sysv/errfuns/esrmnt.S index b9900eedc..d90b0d979 100644 --- a/libc/sysv/errfuns/esrmnt.S +++ b/libc/sysv/errfuns/esrmnt.S @@ -9,7 +9,7 @@ esrmnt: jmp __errfun #elif defined(__aarch64__) adrp x1,ESRMNT - ldr w0,[x1,#:lo12:ESRMNT] + ldrsw x0,[x1,#:lo12:ESRMNT] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/estale.S b/libc/sysv/errfuns/estale.S index e941b67a6..ee9a24ffb 100644 --- a/libc/sysv/errfuns/estale.S +++ b/libc/sysv/errfuns/estale.S @@ -9,7 +9,7 @@ estale: jmp __errfun #elif defined(__aarch64__) adrp x1,ESTALE - ldr w0,[x1,#:lo12:ESTALE] + ldrsw x0,[x1,#:lo12:ESTALE] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/estrpipe.S b/libc/sysv/errfuns/estrpipe.S index e2a971be1..b736116d8 100644 --- a/libc/sysv/errfuns/estrpipe.S +++ b/libc/sysv/errfuns/estrpipe.S @@ -9,7 +9,7 @@ estrpipe: jmp __errfun #elif defined(__aarch64__) adrp x1,ESTRPIPE - ldr w0,[x1,#:lo12:ESTRPIPE] + ldrsw x0,[x1,#:lo12:ESTRPIPE] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/etime.S b/libc/sysv/errfuns/etime.S index af106fac2..cb50018ce 100644 --- a/libc/sysv/errfuns/etime.S +++ b/libc/sysv/errfuns/etime.S @@ -9,7 +9,7 @@ etime: jmp __errfun #elif defined(__aarch64__) adrp x1,ETIME - ldr w0,[x1,#:lo12:ETIME] + ldrsw x0,[x1,#:lo12:ETIME] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/etimedout.S b/libc/sysv/errfuns/etimedout.S index dfa399bbe..b53ed6abf 100644 --- a/libc/sysv/errfuns/etimedout.S +++ b/libc/sysv/errfuns/etimedout.S @@ -9,7 +9,7 @@ etimedout: jmp __errfun #elif defined(__aarch64__) adrp x1,ETIMEDOUT - ldr w0,[x1,#:lo12:ETIMEDOUT] + ldrsw x0,[x1,#:lo12:ETIMEDOUT] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/etoomanyrefs.S b/libc/sysv/errfuns/etoomanyrefs.S index 23d461f90..f7fba30c0 100644 --- a/libc/sysv/errfuns/etoomanyrefs.S +++ b/libc/sysv/errfuns/etoomanyrefs.S @@ -9,7 +9,7 @@ etoomanyrefs: jmp __errfun #elif defined(__aarch64__) adrp x1,ETOOMANYREFS - ldr w0,[x1,#:lo12:ETOOMANYREFS] + ldrsw x0,[x1,#:lo12:ETOOMANYREFS] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/etxtbsy.S b/libc/sysv/errfuns/etxtbsy.S index 59943310e..53bdc8477 100644 --- a/libc/sysv/errfuns/etxtbsy.S +++ b/libc/sysv/errfuns/etxtbsy.S @@ -9,7 +9,7 @@ etxtbsy: jmp __errfun #elif defined(__aarch64__) adrp x1,ETXTBSY - ldr w0,[x1,#:lo12:ETXTBSY] + ldrsw x0,[x1,#:lo12:ETXTBSY] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/euclean.S b/libc/sysv/errfuns/euclean.S index dc27b67ba..41ae1eb6c 100644 --- a/libc/sysv/errfuns/euclean.S +++ b/libc/sysv/errfuns/euclean.S @@ -9,7 +9,7 @@ euclean: jmp __errfun #elif defined(__aarch64__) adrp x1,EUCLEAN - ldr w0,[x1,#:lo12:EUCLEAN] + ldrsw x0,[x1,#:lo12:EUCLEAN] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eunatch.S b/libc/sysv/errfuns/eunatch.S index 354c529e1..21a86eb4c 100644 --- a/libc/sysv/errfuns/eunatch.S +++ b/libc/sysv/errfuns/eunatch.S @@ -9,7 +9,7 @@ eunatch: jmp __errfun #elif defined(__aarch64__) adrp x1,EUNATCH - ldr w0,[x1,#:lo12:EUNATCH] + ldrsw x0,[x1,#:lo12:EUNATCH] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/eusers.S b/libc/sysv/errfuns/eusers.S index 14369e65b..f3af8b287 100644 --- a/libc/sysv/errfuns/eusers.S +++ b/libc/sysv/errfuns/eusers.S @@ -9,7 +9,7 @@ eusers: jmp __errfun #elif defined(__aarch64__) adrp x1,EUSERS - ldr w0,[x1,#:lo12:EUSERS] + ldrsw x0,[x1,#:lo12:EUSERS] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/exdev.S b/libc/sysv/errfuns/exdev.S index 294e2d7a9..e4dd8b967 100644 --- a/libc/sysv/errfuns/exdev.S +++ b/libc/sysv/errfuns/exdev.S @@ -9,7 +9,7 @@ exdev: jmp __errfun #elif defined(__aarch64__) adrp x1,EXDEV - ldr w0,[x1,#:lo12:EXDEV] + ldrsw x0,[x1,#:lo12:EXDEV] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/errfuns/exfull.S b/libc/sysv/errfuns/exfull.S index 75a3b9cb9..0979bf38c 100644 --- a/libc/sysv/errfuns/exfull.S +++ b/libc/sysv/errfuns/exfull.S @@ -9,7 +9,7 @@ exfull: jmp __errfun #elif defined(__aarch64__) adrp x1,EXFULL - ldr w0,[x1,#:lo12:EXFULL] + ldrsw x0,[x1,#:lo12:EXFULL] b __errfun #else #error "unsupported architecture" diff --git a/libc/sysv/gen.sh b/libc/sysv/gen.sh index 1d566c8b2..129e9bc37 100644 --- a/libc/sysv/gen.sh +++ b/libc/sysv/gen.sh @@ -21,24 +21,35 @@ rm -f $dir/*.s $dir/*.S IFS="," +if [ x"$(((0x8d18fc8d128e6807 & 0x7ff000) >> 12))" != x230 ]; then + echo "error: $SHELL does not support bitwise expressions" >&2 + exit 1 +fi + scall() { { + name=$1 + amd=$2 + arm_linux=$(($3 + 0)) + arm_xnu=$((($amd & 0xfff000) >> 12)) + if [ $arm_xnu != 4095 ]; then + arm_xnu=$(($arm_xnu & 0x7ff)) + fi + shift 3 + set -- "$name" "$amd" "$arm_linux" "$arm_xnu" "$*" echo "#include \"libc/sysv/macros.internal.h\"" echo ".scall" "$*" } >"$dir/${1/$/-}.S" } syscon() { - if [ -f "libc/sysv/dos2errno/${2/$/-}.S" ]; then - EXT=".S" - else - EXT=".s" - fi { echo "#include \"libc/sysv/consts/syscon.internal.h\"" echo ".syscon" "$*" if [ -f "libc/sysv/dos2errno/${2/$/-}.S" ]; then + echo "#ifdef __x86_64__" echo ".yoink kDos2Errno.${2/$/-}" + echo "#endif" fi } >"$dir/${2/$/-}.S" } @@ -63,7 +74,7 @@ errfun() { jmp __errfun #elif defined(__aarch64__) adrp x1,%s - ldr w0,[x1,#:lo12:%s] + ldrsw x0,[x1,#:lo12:%s] b __errfun #else #error "unsupported architecture" @@ -80,6 +91,9 @@ dos() { cat <"$dir/${UNIX/$/-}.S" // generated by libc/sysv/dos2errno.sh #include "libc/nt/errors.h" +#ifndef __x86_64__ + .end +#endif .macro .e doscode systemv .short \doscode .long \systemv diff --git a/libc/stubs/assertfail.S b/libc/sysv/hostos.S similarity index 82% rename from libc/stubs/assertfail.S rename to libc/sysv/hostos.S index 2ceabaad3..10c3fa15f 100644 --- a/libc/stubs/assertfail.S +++ b/libc/sysv/hostos.S @@ -1,7 +1,7 @@ /*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│ │vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi│ ╞══════════════════════════════════════════════════════════════════════════════╡ -│ Copyright 2020 Justine Alexandra Roberts Tunney │ +│ Copyright 2023 Justine Alexandra Roberts Tunney │ │ │ │ Permission to use, copy, modify, and/or distribute this software for │ │ any purpose with or without fee is hereby granted, provided that the │ @@ -16,19 +16,10 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "ape/macros.internal.h" -.real -.code16 # ∩ .code32 ∩ .code64 +#include "libc/macros.internal.h" -// Lightweight universal overridable assert() macro support. -// -// @see libc/log/__assert_fail.c -// @mode long,legacy,real -// @noreturn -__assert_fail: - int3 - push %bp - mov %sp,%bp - rlcall __panic - int3 - .endfn __assert_fail,weak + .bss + .balign 8 +__hostos: + .quad 0 + .endfn __hostos,globl diff --git a/libc/sysv/macros.internal.h b/libc/sysv/macros.internal.h index 12912ac8a..7b06b4228 100644 --- a/libc/sysv/macros.internal.h +++ b/libc/sysv/macros.internal.h @@ -15,11 +15,11 @@ * risk of slowing down builds too much with complicated headers. */ -.macro .scall name:req amd:req arm:req kw1 kw2 +.macro .scall name:req amd:req arm_linux:req arm_xnu:req kw1 kw2 .section .text.syscall,"ax",@progbits #ifdef __x86_64__ .ifnb \kw2 - .align 16 + .balign 16 \name: movabs $\amd,%rax jmp *__systemfive(%rip) .else @@ -31,20 +31,56 @@ pop %rbp ret .endif + .endfn \name,\kw1,\kw2 #elif defined(__aarch64__) -\name: - .ifc \arm,0xfff - mov x0,#-38 // -ENOSYS + .ifc \arm_linux,4095 + .ifc \arm_xnu,4095 +// return enosys(); +\name: b enosys + .endfn \name,\kw1,\kw2 .else - mov x8,#\arm - svc #0 - .endif +// return IsXnu() ? syscall(x16, ...) : syscall(x8, ...); +\name: adrp x9,__hostos + ldr w9,[x9,#:lo12:__hostos] + tbz x9,#3,1f // !IsXnu() + mov x16,#\arm_xnu // apple ordinal + svc #0 // issue system call + bcs 1f + b _sysret +1: neg x0,x0 b _sysret .hidden _sysret + .endfn \name,\kw1,\kw2 + .endif + .else + .ifc \arm_xnu,4095 +// return IsLinux() ? syscall(x8, ...) : enosys(); +\name: adrp x9,__hostos + ldr w9,[x9,#:lo12:__hostos] + tbz x9,#0,1f // !IsLinux() + mov x8,#\arm_linux // systemd ordinal + svc #0 // issue system call + mov x1,#\arm_linux + b _sysret + .hidden _sysret +1: b enosys + .endfn \name,\kw1,\kw2 + .else +\name: mov x16,#\arm_xnu // apple ordinal + mov x8,#\arm_linux // systemd ordinal + eor x9,x9,x9 // clear carry flag + svc #0 // issue system call + bcs 1f + b _sysret +1: neg x0,x0 + b _sysret + .hidden _sysret + .endfn \name,\kw1,\kw2 + .endif + .endif #else #error "architecture unsupported" #endif - .endfn \name,\kw1,\kw2 .previous .endm diff --git a/libc/sysv/syscalls.sh b/libc/sysv/syscalls.sh index 5d7974035..11853697e 100755 --- a/libc/sysv/syscalls.sh +++ b/libc/sysv/syscalls.sh @@ -296,7 +296,7 @@ scall sys_sync_file_range 0xfffffffffffff115 0x054 globl hidden # Linux 2.6.17+ scall sys_vmsplice 0xfffffffffffff116 0x04b globl hidden scall sys_migrate_pages 0xfffffffffffff100 0x0ee globl # no wrapper; numa numa yay scall sys_move_pages 0xfffffffffffff117 0x0ef globl # no wrapper; NOTE: We view Red Hat versions as "epochs" for all distros. -#──────────────────────RHEL 5.0 LIMIT──────────────────────── # ←┬─ last distro with gplv2 licensed compiler c. 2007 +#──────────────────────RHEL 5.0 LIMIT──────────────────────────────── # ←┬─ last distro with gplv2 licensed compiler c. 2007 scall sys_preadv 0x92190b9212a1c927 0x045 globl hidden # ├─ last distro with system v shell script init scall sys_pwritev 0x92290c9222a1d928 0x046 globl hidden # ├─ rob landley unleashes busybox gpl lawsuits scall __sys_utimensat 0x1d3054223ffff118 0x058 globl hidden # ├─ python modules need this due to pep513 @@ -317,7 +317,7 @@ scall sys_eventfd2 0xfffffffffffff122 0x013 globl # no wrapper scall sys_timerfd_create 0xfffffffffffff11b 0x055 globl # no wrapper scall sys_timerfd_settime 0xfffffffffffff11e 0x056 globl # no wrapper scall sys_timerfd_gettime 0xfffffffffffff11f 0x057 globl # no wrapper -#──────────────────────RHEL 6.0 LIMIT──────────────────────── # ←┬─ modern glibc needs rhel6+ c. 2011 +#──────────────────────RHEL 6.0 LIMIT──────────────────────────────── # ←┬─ modern glibc needs rhel6+ c. 2011 scall sys_recvmmsg 0x1dbffffffffff12b 0x0f3 globl # ├─ end of life 2024-06-30 (extended) scall sys_fanotify_init 0xfffffffffffff12c 0x106 globl # ├─ last distro with the original gnome desktop scall sys_fanotify_mark 0xfffffffffffff12d 0x107 globl # └─ apple and google condemn the gplv3/gccrtev3 @@ -333,7 +333,7 @@ scall sys_process_vm_readv 0xfffffffffffff136 0x10e globl # no wrapper scall sys_process_vm_writev 0xfffffffffffff137 0x10f globl # no wrapper scall sys_kcmp 0xfffffffffffff138 0x110 globl # no wrapper scall sys_finit_module 0xfffffffffffff139 0x111 globl # no wrapper -#──────────────────────RHEL 7.0 LIMIT──────────────────────── # ←┬─ anything that links or uses c++11 code needs rhel7+ c. 2014 +#──────────────────────RHEL 7.0 LIMIT──────────────────────────────── # ←┬─ anything that links or uses c++11 code needs rhel7+ c. 2014 scall sys_sched_setattr 0xfffffffffffff13a 0x112 globl # ├─ desktop replaced with tablet-first gui inspired by mac os x scall sys_sched_getattr 0xfffffffffffff13b 0x113 globl # ├─ karen sandler requires systemd init and boot for tablet gui scall sys_renameat2 0xfffffffffffff13c 0x114 globl # └─ debian founder ian murdock found strangled with vacuum cord @@ -355,12 +355,12 @@ scall sys_pkey_free 0xfffffffffffff14b 0x122 globl # no wrapper scall sys_statx 0xfffffffffffff14c 0x123 globl # no wrapper; lool https://lkml.org/lkml/2010/7/22/249 scall sys_io_pgetevents 0xfffffffffffff14d 0x124 globl # no wrapper scall sys_rseq 0xfffffffffffff14e 0x125 globl # no wrapper; Linux 4.18+ (c. 2018) -#──────────────────────LINUX 4.18 LIMIT────────────────────── # ←┬─ last version of linux kernel buildable with only gplv2 +#──────────────────────LINUX 4.18 LIMIT────────────────────────────── # ←┬─ last version of linux kernel buildable with only gplv2 scall sys_pidfd_send_signal 0xfffffffffffff1a8 0x1a8 globl # ├─ linux conferences ban linux founder linus torvalds scall sys_io_uring_setup 0xfffffffffffff1a9 0x1a9 globl # └─ gnu founder richard stallman publicly disgraced scall sys_io_uring_enter 0xfffffffffffff1aa 0x1aa globl scall sys_io_uring_register 0xfffffffffffff1ab 0x1ab globl -#────────────────────────RHEL CLOUD────────────────────────── # ←──────┬─ red hat terminates community release of enterprise linux circa 2020 +#────────────────────────RHEL CLOUD────────────────────────────────── # ←──────┬─ red hat terminates community release of enterprise linux circa 2020 scall sys_pledge 0xfff06cffffffffff 0xfff globl hidden # └─ online linux services ban the president of united states of america scall sys_msyscall 0xfff025ffffffffff 0xfff globl # no wrapper scall sys_bogus 0x00b5005002500500 0xfff globl @@ -395,7 +395,7 @@ scall sys_set_mempolicy_home_node 0xfffffffffffff1c2 0xfff globl # no wrapper # FreeBSD┐ │ │ # OpenBSD┐ │ ┌─│──│── XnuClass{1:Mach,2:Unix} # NetBSD┐ │ │ │ │ │ -# Symbol ┌┴┐┌┴┐┌┴┐│┬┴┐┌┴┐ Directives & Commentary +# Symbol ┌┴┐┌┴┐┌┴┐│┬┴┐┌┴┐ Arm64 Type Directives & Commentary scall sys_ktrace 0x02d02d02dfffffff 0xfff globl # no wrapper scall sys_kqueue 0x15810d16a216afff 0xfff globl # no wrapper scall sys_kevent 0x1b30482302171fff 0xfff globl # no wrapper @@ -415,7 +415,7 @@ scall sys_issetugid 0xfff0fd0fd2147fff 0xfff globl hidden scall sys_minherit 0x1110fa0fa20fafff 0xfff globl # no wrapper scall sys_pathconf 0x0bf0bf0bf20bffff 0xfff globl # no wrapper scall sys_sysctl 0x0ca0ca0ca20cafff 0xfff globl # no wrapper -#──────────────────XNU & FREEBSD & NETBSD──────────────────── +#──────────────────XNU & FREEBSD & NETBSD──────────────────────────────────── scall sys_sem_init 0x0f7fff194fffffff 0xfff globl scall sys_sem_destroy 0x0fffff198fffffff 0xfff globl scall sys_sem_open 0x0f8fff195210cfff 0xfff globl @@ -427,7 +427,7 @@ scall sys_sem_trywait 0x0fdfff1932110fff 0xfff globl scall sys_sem_timedwait 0x900fff9b9fffffff 0xfff globl scall sys_sem_wait_nocancel 0xfffffffff21a4fff 0xfff globl # no wrapper scall sys_sem_getvalue 0x0fefff197fffffff 0xfff globl -#───────────────────────XNU & FREEBSD──────────────────────── +#───────────────────────XNU & FREEBSD──────────────────────────────────────── scall sys_ntp_adjtime 0x0b0fff0b0220ffff 0xfff globl # no wrapper scall sys_ntp_gettime 0x1c0fff0f82210fff 0xfff globl # no wrapper scall sys_shm_unlink 0xffffff1e3210bfff 0xfff globl # no wrapper @@ -458,14 +458,14 @@ scall sys_semsys 0xffffff0a920fbfff 0xfff globl # no wrapper scall sys_auditon 0xffffff1be215ffff 0xfff globl # no wrapper scall sys_msgsys 0xffffff0aa20fcfff 0xfff globl # no wrapper scall sys_shmsys 0xffffff0ab20fdfff 0xfff globl # no wrapper -#─────────────────────FREEBSD & OPENBSD────────────────────── +#─────────────────────FREEBSD & OPENBSD────────────────────────────────────── scall sys_fhstat 0x1c3126229fffffff 0xfff globl # no wrapper scall sys_chflagsat 0xfff06b21cfffffff 0xfff globl # no wrapper scall sys_profil 0x02c02c02cfffffff 0xfff globl # no wrapper scall sys_fhstatfs 0xfff04122efffffff 0xfff globl # no wrapper scall sys_utrace 0x1320d114ffffffff 0xfff globl # no wrapper scall sys_closefrom 0xfff11f1fdfffffff 0xfff globl hidden -#───────────────────────────XNU────────────────────────────── +#───────────────────────────XNU────────────────────────────────────────────── #scall __pthread_markcancel 0xfffffffff214cfff 0xfff globl #scall __pthread_kill 0xfffffffff2148fff 0xfff globl #scall __pthread_fchdir 0xfffffffff215dfff 0xfff globl @@ -634,7 +634,7 @@ scall sys_bsdthread_register 0xfffffffff216efff 0xfff globl hidden #scall workq_open 0xfffffffff216ffff 0xfff globl #scall write_nocancel 0xfffffffff218dfff 0xfff globl #scall writev_nocancel 0xfffffffff219cfff 0xfff globl -#──────────────────────────FREEBSD─────────────────────────── +#──────────────────────────FREEBSD─────────────────────────────────────────── #scall sys_umtx_op 0xffffff1c6fffffff 0xfff globl #scall abort2 0xffffff1cffffffff 0xfff globl #scall afs3_syscall 0xffffff179fffffff 0xfff globl @@ -762,7 +762,7 @@ scall sys_rtprio_thread 0xffffff1d2fffffff 0xfff globl # no wrapper #scall wait 0xffffff054fffffff 0xfff globl #scall wait6 0x1e1fff214fffffff 0xfff globl #scall yield 0xffffff141fffffff 0xfff globl -#──────────────────────────OPENBSD─────────────────────────── +#──────────────────────────OPENBSD─────────────────────────────────────────── #scall __thrsleep 0xfff05effffffffff 0xfff globl #scall __thrwakeup 0xfff12dffffffffff 0xfff globl #scall __threxit 0xfff12effffffffff 0xfff globl @@ -782,7 +782,7 @@ scall sys_rtprio_thread 0xffffff1d2fffffff 0xfff globl # no wrapper #scall swapctl 0x10f0c1ffffffffff 0xfff globl #scall thrkill 0xfff077ffffffffff 0xfff globl scall sys_unveil 0xfff072ffffffffff 0xfff globl hidden -#──────────────────────────NETBSD──────────────────────────── +#──────────────────────────NETBSD──────────────────────────────────────────── #scall _lwp_create 0x135fffffffffffff 0xfff globl # int _lwp_create(const struct ucontext_netbsd *ucp, uint64_t flags, int *new_lwp) #scall _lwp_exit 0x136fffffffffffff 0xfff globl # int _lwp_exit(void) #scall _lwp_self 0x137fffffffffffff 0xfff globl # int _lwp_self(void) diff --git a/libc/sysv/syscon.S b/libc/sysv/syscon.S new file mode 100644 index 000000000..e1ab0704b --- /dev/null +++ b/libc/sysv/syscon.S @@ -0,0 +1,100 @@ +/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│ +│vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Copyright 2023 Justine Alexandra Roberts Tunney │ +│ │ +│ Permission to use, copy, modify, and/or distribute this software for │ +│ any purpose with or without fee is hereby granted, provided that the │ +│ above copyright notice and this permission notice appear in all copies. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ +│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ +│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ +│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ +│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ +│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ +│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ +│ PERFORMANCE OF THIS SOFTWARE. │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/dce.h" +#include "libc/macros.internal.h" + +#ifdef __x86_64__ +#define ROALIGN 1 +#else +#define ROALIGN 8 +#endif + +// Sections for varint encoded magic numbers. +// +// These sections are all ordered by (group_name, constant_name). +// They're populated by modules simply referencing the symbols. +// +// @see libc/sysv/consts.sh +// @see libc/sysv/consts/syscon_h + .section .piro.bss.sort.syscon.1,"aw",@nobits + .balign 8 +syscon_start:/* + ...decentralized quadwords... + */.previous + .section .piro.bss.sort.syscon.3,"aw",@nobits +syscon_end: + .previous + .type syscon_start,@object + .type syscon_end,@object + .globl syscon_start + .globl syscon_end +#if SupportsLinux() || SupportsMetal() + .section .sort.rodata.syscon.linux.1,"a",@progbits + .balign ROALIGN +syscon_linux:/* + ...decentralized leb128... + */.previous + .type syscon_linux,@object + .globl syscon_linux +#endif +#if SupportsXnu() + .section .sort.rodata.syscon.xnu.1,"a",@progbits + .balign ROALIGN +syscon_xnu:/* + ...decentralized leb128... + */.previous + .type syscon_xnu,@object + .globl syscon_xnu +#endif +#if SupportsFreebsd() + .section .sort.rodata.syscon.freebsd.1,"a",@progbits + .balign ROALIGN +syscon_freebsd:/* + ...decentralized leb128... + */.previous + .type syscon_freebsd,@object + .globl syscon_freebsd +#endif +#if SupportsOpenbsd() + .section .sort.rodata.syscon.openbsd.1,"a",@progbits + .balign ROALIGN +syscon_openbsd:/* + ...decentralized leb128... + */.previous + .type syscon_openbsd,@object + .globl syscon_openbsd +#endif +#if SupportsNetbsd() + .section .sort.rodata.syscon.netbsd.1,"a",@progbits + .balign ROALIGN +syscon_netbsd:/* + ...decentralized leb128... + */.previous + .type syscon_netbsd,@object + .globl syscon_netbsd +#endif +#if SupportsWindows() + .section .sort.rodata.syscon.windows.1,"a",@progbits + .balign ROALIGN +syscon_windows:/* + ...decentralized leb128... + */.previous + .type syscon_windows,@object + .globl syscon_windows +#endif diff --git a/libc/sysv/syslib.S b/libc/sysv/syslib.S new file mode 100644 index 000000000..e0fa2559c --- /dev/null +++ b/libc/sysv/syslib.S @@ -0,0 +1,25 @@ +/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│ +│vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Copyright 2023 Justine Alexandra Roberts Tunney │ +│ │ +│ Permission to use, copy, modify, and/or distribute this software for │ +│ any purpose with or without fee is hereby granted, provided that the │ +│ above copyright notice and this permission notice appear in all copies. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ +│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ +│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ +│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ +│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ +│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ +│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ +│ PERFORMANCE OF THIS SOFTWARE. │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/macros.internal.h" + + .bss + .balign 8 +__syslib: + .quad 0 + .endfn __syslib,globl diff --git a/libc/sysv/systemfive.S b/libc/sysv/systemfive.S index c028386cb..8def555b4 100644 --- a/libc/sysv/systemfive.S +++ b/libc/sysv/systemfive.S @@ -67,9 +67,6 @@ ╚────────────────────────────────────────────────────────────────────────────│*/ .initbss 300,_init_systemfive -__hostos: - .quad 0 - .endobj __hostos,globl,hidden // Performs System Five System Call. // @@ -268,7 +265,7 @@ systemfive_xnu: push %rbx push %rsi // Detect the operating system. - mov (%rdi),%eax # __hostos + mov __hostos(%rip),%eax #if SupportsWindows() || SupportsXnu() || SupportsFreebsd() // set by libc/ape.S for XNU // set by libc/crt/crt.S for XNU/FreeBSD @@ -296,7 +293,7 @@ systemfive_xnu: #endif mov $_HOSTLINUX,%al _init_systemfive_detected: - stosq #→ __hostos + mov %eax,__hostos(%rip) bsr %eax,%eax mov $_init_systemfive_jmptab,%ebx movzbl (%rbx,%rax),%eax @@ -452,80 +449,6 @@ _init_systemfive_done: nop .init.end 300,_init_systemfive,globl,hidden -// Sections for varint encoded magic numbers. -// -// These sections are all ordered by (group_name, constant_name). -// They're populated by modules simply referencing the symbols. -// -// @see libc/sysv/consts.sh -// @see libc/sysv/consts/syscon_h - .section .piro.bss.sort.syscon.1,"aw",@nobits - .balign 8 -syscon_start:/* - ...decentralized quadwords... - */.previous - .section .piro.bss.sort.syscon.3,"aw",@nobits -syscon_end: - .previous - .type syscon_start,@object - .type syscon_end,@object - .globl syscon_start - .globl syscon_end -#if SupportsLinux() || SupportsMetal() - .section .sort.rodata.syscon.linux.1,"a",@progbits - .balign 1 -syscon_linux:/* - ...decentralized leb128... - */.previous - .type syscon_linux,@object - .globl syscon_linux -#endif -#if SupportsXnu() - .section .sort.rodata.syscon.xnu.1,"a",@progbits - .balign 1 -syscon_xnu:/* - ...decentralized leb128... - */.previous - .type syscon_xnu,@object - .globl syscon_xnu -#endif -#if SupportsFreebsd() - .section .sort.rodata.syscon.freebsd.1,"a",@progbits - .balign 1 -syscon_freebsd:/* - ...decentralized leb128... - */.previous - .type syscon_freebsd,@object - .globl syscon_freebsd -#endif -#if SupportsOpenbsd() - .section .sort.rodata.syscon.openbsd.1,"a",@progbits - .balign 1 -syscon_openbsd:/* - ...decentralized leb128... - */.previous - .type syscon_openbsd,@object - .globl syscon_openbsd -#endif -#if SupportsNetbsd() - .section .sort.rodata.syscon.netbsd.1,"a",@progbits - .balign 1 -syscon_netbsd:/* - ...decentralized leb128... - */.previous - .type syscon_netbsd,@object - .globl syscon_netbsd -#endif -#if SupportsWindows() - .section .sort.rodata.syscon.windows.1,"a",@progbits - .balign 1 -syscon_windows:/* - ...decentralized leb128... - */.previous - .type syscon_windows,@object - .globl syscon_windows -#endif - #ifdef SYSDEBUG .rodata.str1.1 .Llog: .ascii STRACE_PROLOGUE diff --git a/libc/sysv/sysv.mk b/libc/sysv/sysv.mk index eae66df98..1b503a48c 100644 --- a/libc/sysv/sysv.mk +++ b/libc/sysv/sysv.mk @@ -33,6 +33,9 @@ LIBC_SYSV_A_DIRECTDEPS = \ LIBC_SYSV_A_FILES := \ libc/sysv/macros.internal.h \ libc/sysv/errfuns.h \ + libc/sysv/hostos.S \ + libc/sysv/syscon.S \ + libc/sysv/syslib.S \ libc/sysv/syscount.S \ libc/sysv/restorert.S \ libc/sysv/syscall.S \ @@ -41,6 +44,7 @@ LIBC_SYSV_A_FILES := \ libc/sysv/sysret.c \ libc/sysv/errno.c \ libc/sysv/errfun.S \ + libc/sysv/errfun2.c \ libc/sysv/strace.greg.c \ libc/sysv/describeos.greg.c \ $(wildcard libc/sysv/consts/*) \ @@ -71,6 +75,8 @@ $(LIBC_SYSV_A).pkg: \ $(foreach x,$(LIBC_SYSV_A_DIRECTDEPS),$($(x)_A).pkg) o/$(MODE)/libc/sysv/errno.o \ +o/$(MODE)/libc/sysv/sysret.o \ +o/$(MODE)/libc/sysv/errfun2.o \ o/$(MODE)/libc/sysv/sysret.o: private \ OVERRIDE_CFLAGS += \ $(NO_MAGIC) @@ -132,7 +138,11 @@ $(LIBC_SYSV_MACHCALLS_A).pkg: \ #─────────────────────────────────────────────────────────────────────────────── # let aarch64 compile these -o/$(MODE)/libc/sysv/errfun.o: libc/sysv/errfun.S +o/$(MODE)/libc/sysv/syscon.o: libc/sysv/syscon.S + @$(COMPILE) -AOBJECTIFY.S $(OBJECTIFY.S) $(OUTPUT_OPTION) $< +o/$(MODE)/libc/sysv/hostos.o: libc/sysv/hostos.S + @$(COMPILE) -AOBJECTIFY.S $(OBJECTIFY.S) $(OUTPUT_OPTION) $< +o/$(MODE)/libc/sysv/syslib.o: libc/sysv/syslib.S @$(COMPILE) -AOBJECTIFY.S $(OBJECTIFY.S) $(OUTPUT_OPTION) $< o/$(MODE)/libc/sysv/syscount.o: libc/sysv/syscount.S @$(COMPILE) -AOBJECTIFY.S $(OBJECTIFY.S) $(OUTPUT_OPTION) $< diff --git a/libc/testlib/benchrunner.c b/libc/testlib/benchrunner.c index 056d533f8..74fce870e 100644 --- a/libc/testlib/benchrunner.c +++ b/libc/testlib/benchrunner.c @@ -38,13 +38,13 @@ void testlib_benchwarmup(void) { "vmovdqa\t%%ymm0,%0\n\t" "vzeroall" : "=m"(g_avx2_juiceup_quadwords_) - : "m"(g_avx2_juiceup_quadwords_), "r"(&_base[0])); + : "m"(g_avx2_juiceup_quadwords_), "r"(&__executable_start[0])); asm("vmovapd\t%1,%%ymm1\n\t" "vfmadd132pd\t(%2),%%ymm1,%%ymm1\n\t" "vmovapd\t%%ymm1,%0\n\t" "vzeroall" : "=m"(g_avx2_juiceup_doubles_) - : "m"(g_avx2_juiceup_doubles_), "r"(&_base[32])); + : "m"(g_avx2_juiceup_doubles_), "r"(&__executable_start[32])); } } diff --git a/libc/thread/tls.h b/libc/thread/tls.h index 182684348..d101194af 100644 --- a/libc/thread/tls.h +++ b/libc/thread/tls.h @@ -39,9 +39,16 @@ struct CosmoTib { }; extern int __threaded; -extern bool __tls_enabled; extern unsigned __tls_index; +#ifdef __x86_64__ +extern bool __tls_enabled; +#define __tls_enabled_set(x) __tls_enabled = x +#else +#define __tls_enabled true +#define __tls_enabled_set(x) (void)0 +#endif + void __require_tls(void); void __set_tls(struct CosmoTib *); diff --git a/libc/tinymath/copysign.c b/libc/tinymath/copysign.c index ee21129b0..df3cb7830 100644 --- a/libc/tinymath/copysign.c +++ b/libc/tinymath/copysign.c @@ -30,3 +30,7 @@ double copysign(double x, double y) { ux.i |= uy.i & 1ULL << 63; return ux.f; } + +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 +__strong_reference(copysign, copysignl); +#endif diff --git a/libc/tinymath/copysignl.c b/libc/tinymath/copysignl.c index 5e086f2c0..7c0639cbf 100644 --- a/libc/tinymath/copysignl.c +++ b/libc/tinymath/copysignl.c @@ -18,19 +18,16 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/math.h" #include "libc/tinymath/ldshape.internal.h" +#if !(LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024) /** * Returns 𝑥 with same sign as 𝑦. */ long double copysignl(long double x, long double y) { -#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 - return copysign(x, y); -#elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 113) && LDBL_MAX_EXP == 16384 union ldshape ux = {x}, uy = {y}; ux.i.se &= 0x7fff; ux.i.se |= uy.i.se & 0x8000; return ux.f; -#else -#error "architecture unsupported" -#endif } + +#endif /* long double is long */ diff --git a/libc/tinymath/fma.c b/libc/tinymath/fma.c index aa5f09231..25892c0fb 100644 --- a/libc/tinymath/fma.c +++ b/libc/tinymath/fma.c @@ -92,40 +92,41 @@ static void mul(uint64_t *hi, uint64_t *lo, uint64_t x, uint64_t y) */ double fma(double x, double y, double z) { -#if defined(__x86_64__) && defined(__FMA__) +#if defined(__x86_64__) && defined(__FMA__) && defined(__FAST_MATH__) // Intel Haswell+ (c. 2013) // AMD Piledriver+ (c. 2011) asm("vfmadd132sd\t%1,%2,%0" : "+x"(x) : "x"(y), "x"(z)); return x; -#elif defined(__x86_64__) && defined(__FMA4__) +#elif defined(__x86_64__) && defined(__FMA4__) && defined(__FAST_MATH__) // AMD Bulldozer+ (c. 2011) asm("vfmaddsd\t%3,%2,%1,%0" : "=x"(x) : "x"(x), "x"(y), "x"(z)); return x; -#elif defined(__aarch64__) +#elif defined(__aarch64__) && defined(__FAST_MATH__) asm("fmadd\t%d0,%d1,%d2,%d3" : "=w"(x) : "w"(x), "w"(y), "w"(z)); return x; -#elif defined(__powerpc64__) +#elif defined(__powerpc64__) && defined(__FAST_MATH__) asm("fmadd\t%0,%1,%2,%3" : "=d"(x) : "d"(x), "d"(y), "d"(z)); return x; -#elif defined(__riscv) && __riscv_flen >= 64 +#elif defined(__riscv) && __riscv_flen >= 64 && defined(__FAST_MATH__) asm("fmadd.d\t%0,%1,%2,%3" : "=f"(x) : "f"(x), "f"(y), "f"(z)); return x; -#elif defined(__s390x__) +#elif defined(__s390x__) && defined(__FAST_MATH__) asm("madbr\t%0,\t%1,\t%2" : "+f"(z) : "f"(x), "f"(y)); return z; #else +// #pragma STDC FENV_ACCESS ON /* normalize so top 10bits and last bit are 0 */ struct num nx, ny, nz; diff --git a/libc/tinymath/fsum.c b/libc/tinymath/fsum.c index cdfdd2285..7a865da20 100644 --- a/libc/tinymath/fsum.c +++ b/libc/tinymath/fsum.c @@ -17,15 +17,19 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/math.h" -#include "libc/str/str.h" /** * Adds doubles in array. */ double fsum(const double *p, size_t n) { size_t i; - double s; - if (n > 8) return fsum(p, n / 2) + fsum(p + n / 2, n - n / 2); - for (s = i = 0; i < n; ++i) s += p[i]; - return s; + double err, sum, t, y; + sum = err = 0; + for (i = 0; i < n; ++i) { + y = p[i] - err; + t = sum + y; + err = (t - sum) - y; + sum = t; + } + return sum; } diff --git a/libc/tinymath/fsumf.c b/libc/tinymath/fsumf.c index 4be39a87b..1e267488f 100644 --- a/libc/tinymath/fsumf.c +++ b/libc/tinymath/fsumf.c @@ -17,7 +17,6 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/math.h" -#include "libc/str/str.h" /** * Adds floats in array. diff --git a/libc/tinymath/ilogb.c b/libc/tinymath/ilogb.c index 5eca8a17f..9a5fa5c4c 100644 --- a/libc/tinymath/ilogb.c +++ b/libc/tinymath/ilogb.c @@ -61,3 +61,7 @@ int ilogb(double x) } return e - 0x3ff; } + +#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 +__strong_reference(ilogb, ilogbl); +#endif diff --git a/libc/tinymath/ilogbl.c b/libc/tinymath/ilogbl.c index 1b81ebac5..cb18842ef 100644 --- a/libc/tinymath/ilogbl.c +++ b/libc/tinymath/ilogbl.c @@ -29,6 +29,7 @@ #include "libc/math.h" #include "libc/tinymath/internal.h" #include "libc/tinymath/ldshape.internal.h" +#if !(LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024) asm(".ident\t\"\\n\\n\ Musl libc (MIT License)\\n\ @@ -39,11 +40,10 @@ asm(".include \"libc/disclaimer.inc\""); /** * Returns log₂𝑥 exponent part of double. */ -int ilogbl(long double x) { -#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 - return ilogb(x); -#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 - // #pragma STDC FENV_ACCESS ON +int ilogbl(long double x) +{ +#if LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 16384 +// #pragma STDC FENV_ACCESS ON union ldshape u = {x}; uint64_t m = u.i.m; int e = u.i.se & 0x7fff; @@ -63,7 +63,7 @@ int ilogbl(long double x) { } return e - 0x3fff; #elif LDBL_MANT_DIG == 113 && LDBL_MAX_EXP == 16384 - // #pragma STDC FENV_ACCESS ON +// #pragma STDC FENV_ACCESS ON union ldshape u = {x}; int e = u.i.se & 0x7fff; @@ -82,8 +82,7 @@ int ilogbl(long double x) { return u.f ? FP_ILOGBNAN : INT_MAX; } return e - 0x3fff; -#else -#error "architecture unsupported" #endif } +#endif /* long double is long */ diff --git a/libc/tinymath/lrint.c b/libc/tinymath/lrint.c index f25c08454..a1443269a 100644 --- a/libc/tinymath/lrint.c +++ b/libc/tinymath/lrint.c @@ -67,7 +67,7 @@ as a double. #define EPS LDBL_EPSILON #endif static dontinline long lrint_slow(double x) { - // #pragma STDC FENV_ACCESS ON +// #pragma STDC FENV_ACCESS ON int e; e = fetestexcept(FE_INEXACT); x = rint(x); diff --git a/libc/tinymath/lrintl.c b/libc/tinymath/lrintl.c index d07d99183..d5d052e9e 100644 --- a/libc/tinymath/lrintl.c +++ b/libc/tinymath/lrintl.c @@ -38,6 +38,9 @@ Copyright 2005-2014 Rich Felker, et. al.\""); asm(".include \"libc/disclaimer.inc\""); // clang-format off +/** + * Rounds to nearest integer. + */ long lrintl(long double x) { #ifdef FE_INEXACT @@ -48,7 +51,7 @@ Note that if LONG_MAX == 0x7fffffffffffffff && LDBL_MANT_DIG == 64 then x == 2**63 - 0.5 is the only input that overflows and raises inexact (with tonearest or upward rounding mode) */ - // #pragma STDC FENV_ACCESS ON +// #pragma STDC FENV_ACCESS ON int e; e = fetestexcept(FE_INEXACT); diff --git a/libc/tinymath/magicu.c b/libc/tinymath/magicu.c index 81bea421f..e54a99a57 100644 --- a/libc/tinymath/magicu.c +++ b/libc/tinymath/magicu.c @@ -17,6 +17,7 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/tinymath/magicu.h" +#include "libc/assert.h" /** * Precomputes magic numbers for unsigned division by constant. @@ -27,7 +28,7 @@ * assert(77 / 7 == __magicu_div(77, __magicu_get(7))); * * @param d is intended divisor, which must not be zero - * @return magic divisor + * @return magic divisor (never zero) */ struct magicu __magicu_get(uint32_t d) { // From Hacker's Delight by Henry S. Warren Jr., 9780321842688 @@ -35,6 +36,7 @@ struct magicu __magicu_get(uint32_t d) { int a, p; struct magicu magu; uint32_t p32, q, r, delta; + _npassert(d); // Can't divide by zero. p32 = 0; // Avoid compiler warning. a = 0; // Initialize "add" indicator. p = 31; // Initialize p. @@ -58,8 +60,9 @@ struct magicu __magicu_get(uint32_t d) { } delta = d - 1 - r; } while (p < 64 && p32 < delta); - magu.M = q + 1; // Magic number and - magu.s = p - 32; // Shift amount to return - if (a) magu.s |= 64; // Sets "add" indicator + magu.M = q + 1; // Magic number and + magu.s = p - 32; // Shift amount to return + if (a) magu.s |= 64; // Sets "add" indicator + _npassert(magu.M || magu.s); // Never returns zero. return magu; } diff --git a/libc/tinymath/magicu.h b/libc/tinymath/magicu.h index 63d4c7c74..d822e2642 100644 --- a/libc/tinymath/magicu.h +++ b/libc/tinymath/magicu.h @@ -21,6 +21,15 @@ forceinline uint32_t __magicu_div(uint32_t x, struct magicu d) { return ((((uint64_t)x * d.M) >> 32) + ((d.s & 64) ? x : 0)) >> (d.s & 63); } +/** + * Checks if 𝑑 contains a valid initialized divisor. + */ +static inline bool __magicu_valid(struct magicu d) { + if (!d.M && !d.s) return false; /* uninitialized */ + if (d.s & ~(64 | 63)) return false; /* corrupted */ + return true; +} + COSMOPOLITAN_C_END_ #endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */ #endif /* COSMOPOLITAN_LIBC_TINYMATH_MAGICU_H_ */ diff --git a/libc/tinymath/tanhf.c b/libc/tinymath/tanhf.c index 4f200e736..fc85a5000 100644 --- a/libc/tinymath/tanhf.c +++ b/libc/tinymath/tanhf.c @@ -2,88 +2,78 @@ │vi: set et ft=c ts=8 tw=8 fenc=utf-8 :vi│ ╚──────────────────────────────────────────────────────────────────────────────╝ │ │ -│ FreeBSD lib/msun/src/s_tanhf.c │ -│ Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. │ +│ Musl Libc │ +│ Copyright © 2005-2014 Rich Felker, et al. │ │ │ -│ Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. │ +│ Permission is hereby granted, free of charge, to any person obtaining │ +│ a copy of this software and associated documentation files (the │ +│ "Software"), to deal in the Software without restriction, including │ +│ without limitation the rights to use, copy, modify, merge, publish, │ +│ distribute, sublicense, and/or sell copies of the Software, and to │ +│ permit persons to whom the Software is furnished to do so, subject to │ +│ the following conditions: │ │ │ -│ Developed at SunPro, a Sun Microsystems, Inc. business. │ -│ Permission to use, copy, modify, and distribute this │ -│ software is freely granted, provided that this notice │ -│ is preserved. │ +│ The above copyright notice and this permission notice shall be │ +│ included in all copies or substantial portions of the Software. │ │ │ -│ Copyright (c) 1992-2023 The FreeBSD Project. │ -│ │ -│ Redistribution and use in source and binary forms, with or without │ -│ modification, are permitted provided that the following conditions │ -│ are met: │ -│ 1. Redistributions of source code must retain the above copyright │ -│ notice, this list of conditions and the following disclaimer. │ -│ 2. Redistributions in binary form must reproduce the above copyright │ -│ notice, this list of conditions and the following disclaimer in the │ -│ documentation and/or other materials provided with the distribution. │ -│ │ -│ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND │ -│ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE │ -│ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE │ -│ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE │ -│ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL │ -│ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS │ -│ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) │ -│ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT │ -│ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY │ -│ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF │ -│ SUCH DAMAGE. │ +│ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, │ +│ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF │ +│ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ +│ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY │ +│ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, │ +│ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE │ +│ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │ │ │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/math.h" -#include "libc/tinymath/freebsd.internal.h" +#include "libc/tinymath/internal.h" asm(".ident\t\"\\n\\n\ -FreeBSD libm (BSD-2 License)\\n\ -Copyright (c) 2005-2011, Bruce D. Evans, Steven G. Kargl, David Schultz.\""); -asm(".ident\t\"\\n\\n\ -fdlibm (fdlibm license)\\n\ -Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.\""); +Musl libc (MIT License)\\n\ +Copyright 2005-2014 Rich Felker, et. al.\""); asm(".include \"libc/disclaimer.inc\""); // clang-format off -static const volatile float tiny = 1.0e-30; -static const float one=1.0, two=2.0, huge = 1.0e30; - /** * Returns hyperbolic tangent of 𝑥. + * + * @define `tanhf(x)=(expf(x)-expf(-x))/(expf(x)+expf(-x))` + * @define `tanhf(x)=(expf(2.f*x)-1.f)/(expf(2.f*x)-1.f+2.f)` */ -float -tanhf(float x) +float tanhf(float x) { - float t,z; - int32_t jx,ix; + union {float f; uint32_t i;} u = {.f = x}; + uint32_t w; + int sign; + float t; - GET_FLOAT_WORD(jx,x); - ix = jx&0x7fffffff; + /* x = |x| */ + sign = u.i >> 31; + u.i &= 0x7fffffff; + x = u.f; + w = u.i; - /* x is INF or NaN */ - if(ix>=0x7f800000) { - if (jx>=0) return one/x+one; /* tanh(+-inf)=+-1 */ - else return one/x-one; /* tanh(NaN) = NaN */ - } - - /* |x| < 9 */ - if (ix < 0x41100000) { /* |x|<9 */ - if (ix<0x39800000) { /* |x|<2**-12 */ - if(huge+x>one) return x; /* tanh(tiny) = tiny with inexact */ - } - if (ix>=0x3f800000) { /* |x|>=1 */ - t = expm1f(two*fabsf(x)); - z = one - two/(t+two); - } else { - t = expm1f(-two*fabsf(x)); - z= -t/(t+two); - } - /* |x| >= 9, return +-1 */ + if (w > 0x3f0c9f54) { + /* |x| > log(3)/2 ~= 0.5493 or nan */ + if (w > 0x41200000) { + /* |x| > 10 */ + t = 1 + 0/x; + } else { + t = expm1f(2*x); + t = 1 - 2/(t+2); + } + } else if (w > 0x3e82c578) { + /* |x| > log(5/3)/2 ~= 0.2554 */ + t = expm1f(2*x); + t = t/(t+2); + } else if (w >= 0x00800000) { + /* |x| >= 0x1p-126 */ + t = expm1f(-2*x); + t = -t/(t+2); } else { - z = one - tiny; /* raise inexact flag */ + /* |x| is subnormal */ + FORCE_EVAL(x*x); + t = x; } - return (jx>=0)? z: -z; + return sign ? -t : t; } diff --git a/libc/tinymath/tinymath.mk b/libc/tinymath/tinymath.mk index b3dd9d441..18bc084f3 100644 --- a/libc/tinymath/tinymath.mk +++ b/libc/tinymath/tinymath.mk @@ -42,13 +42,6 @@ $(LIBC_TINYMATH_A).pkg: \ $(LIBC_TINYMATH_A_OBJS) \ $(foreach x,$(LIBC_TINYMATH_A_DIRECTDEPS),$($(x)_A).pkg) -o/$(MODE)/libc/tinymath/cpow.o \ -o/$(MODE)/libc/tinymath/cpowf.o \ -o/$(MODE)/libc/tinymath/cpowl.o \ -o/$(MODE)/libc/tinymath/powfin.o: private \ - OVERRIDE_CFLAGS += \ - -ffast-math - o/$(MODE)/libc/tinymath/lround.o \ o/$(MODE)/libc/tinymath/lroundf.o \ o/$(MODE)/libc/tinymath/lroundl.o: private \ @@ -60,6 +53,18 @@ o/$(MODE)/libc/tinymath/loglq.o: private \ OVERRIDE_CFLAGS += \ -ffunction-sections +$(LIBC_TINYMATH_A_OBJS): private \ + OVERRIDE_CFLAGS += \ + -fsigned-zeros \ + -ftrapping-math \ + -frounding-math \ + -fsignaling-nans \ + -fno-reciprocal-math \ + -fno-associative-math \ + -fno-finite-math-only \ + -fno-cx-limited-range \ + -ffp-int-builtin-inexact + LIBC_TINYMATH_LIBS = $(foreach x,$(LIBC_TINYMATH_ARTIFACTS),$($(x))) LIBC_TINYMATH_HDRS = $(foreach x,$(LIBC_TINYMATH_ARTIFACTS),$($(x)_HDRS)) LIBC_TINYMATH_SRCS = $(foreach x,$(LIBC_TINYMATH_ARTIFACTS),$($(x)_SRCS)) diff --git a/test/libc/calls/execve_test.c b/test/libc/calls/execve_test.c index 01d30caed..7c2242d99 100644 --- a/test/libc/calls/execve_test.c +++ b/test/libc/calls/execve_test.c @@ -17,10 +17,12 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" +#include "libc/calls/syscall_support-sysv.internal.h" #include "libc/dce.h" #include "libc/errno.h" #include "libc/fmt/conv.h" #include "libc/fmt/itoa.h" +#include "libc/intrin/kprintf.h" #include "libc/runtime/runtime.h" #include "libc/str/str.h" #include "libc/testlib/subprocess.h" @@ -58,12 +60,14 @@ TEST(execve, testArgPassing) { execve(GetProgramExecutableName(), (char *const[]){GetProgramExecutableName(), "-", ibuf, buf, 0}, (char *const[]){0}); - notpossible; + kprintf("execve failed: %m\n"); EXITS(0); } } TEST(execve, ziposELF) { + if (IsFreebsd()) return; // TODO: fixme on freebsd + if (!__is_linux_2_6_23()) return; // TODO: fixme on old linux if (!IsLinux() && !IsFreebsd()) { EXPECT_SYS(ENOSYS, -1, execve("/zip/life.elf", (char *const[]){0}, (char *const[]){0})); @@ -71,11 +75,13 @@ TEST(execve, ziposELF) { } SPAWN(fork); execve("/zip/life.elf", (char *const[]){0}, (char *const[]){0}); - notpossible; + kprintf("execve failed: %m\n"); EXITS(42); } TEST(execve, ziposAPE) { + if (IsFreebsd()) return; // TODO: fixme on freebsd + if (!__is_linux_2_6_23()) return; // TODO: fixme on old linux if (!IsLinux() && !IsFreebsd()) { EXPECT_EQ(-1, execve("/zip/life-nomod.com", (char *const[]){0}, (char *const[]){0})); @@ -83,7 +89,7 @@ TEST(execve, ziposAPE) { } SPAWN(fork); execve("/zip/life-nomod.com", (char *const[]){0}, (char *const[]){0}); - notpossible; + kprintf("execve failed: %m\n"); EXITS(42); } diff --git a/test/libc/calls/fcntl_test.c b/test/libc/calls/fcntl_test.c index 4229f241b..1ded569e1 100644 --- a/test/libc/calls/fcntl_test.c +++ b/test/libc/calls/fcntl_test.c @@ -108,6 +108,7 @@ void OnSig(int sig) { TEST(posixAdvisoryLocks, twoProcesses) { if (IsWindows()) return; // due to signals + if (IsNetbsd()) return; // TODO: why does sigusr1 kill runitd? int ws, pid; struct flock lock; diff --git a/test/libc/calls/fexecve_test.c b/test/libc/calls/fexecve_test.c index c24b5bc11..5058c49b5 100644 --- a/test/libc/calls/fexecve_test.c +++ b/test/libc/calls/fexecve_test.c @@ -17,6 +17,7 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" +#include "libc/calls/syscall_support-sysv.internal.h" #include "libc/dce.h" #include "libc/errno.h" #include "libc/runtime/runtime.h" @@ -35,6 +36,11 @@ int fds[2]; char buf[8]; char testlib_enable_tmp_setup_teardown; +void SetUp(void) { + if (IsFreebsd()) exit(0); // TODO: fixme on freebsd + if (!__is_linux_2_6_23()) exit(0); // TODO: fixme on old linux +} + TEST(execve, elfIsUnreadable_mayBeExecuted) { if (IsWindows() || IsXnu()) return; testlib_extract("/zip/echo", "echo", 0111); diff --git a/test/libc/calls/sched_getaffinity_test.c b/test/libc/calls/sched_getaffinity_test.c index 4a6c6dfe6..8bfcde21c 100644 --- a/test/libc/calls/sched_getaffinity_test.c +++ b/test/libc/calls/sched_getaffinity_test.c @@ -33,6 +33,9 @@ void SetUp(void) { if (!IsLinux() && !IsFreebsd() && !IsWindows()) { exit(0); } + if (IsFreebsd() && getuid() != 0) { + exit(0); + } } TEST(sched_getaffinity, firstOnly) { diff --git a/test/libc/calls/setrlimit_test.c b/test/libc/calls/setrlimit_test.c index 705591815..bcddac05c 100644 --- a/test/libc/calls/setrlimit_test.c +++ b/test/libc/calls/setrlimit_test.c @@ -123,6 +123,7 @@ TEST(setrlimit, testMemoryLimit) { char *p; bool gotsome; int i, wstatus; + if (IsXnu()) return; if (IsAsan()) return; /* b/c we use sys_mmap */ ASSERT_NE(-1, (wstatus = xspawn(0))); if (wstatus == -2) { diff --git a/test/libc/calls/sigaction_test.c b/test/libc/calls/sigaction_test.c index f1965fb8f..90ff6583e 100644 --- a/test/libc/calls/sigaction_test.c +++ b/test/libc/calls/sigaction_test.c @@ -69,6 +69,7 @@ TEST(sigaction, raise) { // test kill() TEST(sigaction, testPingPongParentChildWithSigint) { + if (IsNetbsd()) return; // TODO: what's up with runitd on netbsd? int pid, status; sigset_t blockint, oldmask; struct sigaction oldint; diff --git a/test/libc/calls/signal_test.c b/test/libc/calls/signal_test.c index 7381d54c9..baeabc184 100644 --- a/test/libc/calls/signal_test.c +++ b/test/libc/calls/signal_test.c @@ -18,6 +18,7 @@ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/calls/calls.h" #include "libc/calls/struct/sigaction.h" +#include "libc/dce.h" #include "libc/log/check.h" #include "libc/log/log.h" #include "libc/runtime/runtime.h" diff --git a/test/libc/intrin/fmax_test.c b/test/libc/intrin/fmax_test.c new file mode 100644 index 000000000..870bb8c19 --- /dev/null +++ b/test/libc/intrin/fmax_test.c @@ -0,0 +1,35 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ Copyright 2023 Justine Alexandra Roberts Tunney │ +│ │ +│ Permission to use, copy, modify, and/or distribute this software for │ +│ any purpose with or without fee is hereby granted, provided that the │ +│ above copyright notice and this permission notice appear in all copies. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │ +│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │ +│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │ +│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │ +│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │ +│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │ +│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ +│ PERFORMANCE OF THIS SOFTWARE. │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/testlib/testlib.h" +#include "third_party/libcxx/math.h" + +TEST(fmax, test) { + EXPECT_TRUE(fmax(2., 3.) == 3.); + EXPECT_TRUE(fmax(3., 2.) == 3.); + EXPECT_TRUE(fmax(NAN, 3.) == 3.); + EXPECT_TRUE(fmax(NAN, -3.) == -3.); + EXPECT_TRUE(fmax(-NAN, 3.) == 3.); + EXPECT_TRUE(fmax(-NAN, -3.) == -3.); + EXPECT_TRUE(fmax(3., NAN) == 3.); + EXPECT_TRUE(fmax(-3., NAN) == -3.); + EXPECT_TRUE(fmax(3., -NAN) == 3.); + EXPECT_TRUE(fmax(-3., -NAN) == -3.); + EXPECT_TRUE(fmax(-0., +0.) == +0.); + EXPECT_TRUE(fmax(+0., -0.) == +0.); +} diff --git a/test/libc/runtime/mmap_test.c b/test/libc/runtime/mmap_test.c index aa35cbd4d..2ab9fa6b3 100644 --- a/test/libc/runtime/mmap_test.c +++ b/test/libc/runtime/mmap_test.c @@ -17,6 +17,7 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/linux/mmap.h" +#include "ape/sections.internal.h" #include "libc/calls/calls.h" #include "libc/calls/ucontext.h" #include "libc/dce.h" @@ -77,7 +78,7 @@ TEST(mmap, outOfAutomapRange) { TEST(mmap, noreplaceImage) { ASSERT_SYS(EEXIST, MAP_FAILED, - mmap(_base, FRAMESIZE, PROT_READ, + mmap(__executable_start, FRAMESIZE, PROT_READ, MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED_NOREPLACE, -1, 0)); } diff --git a/test/libc/stdio/getrandom_test.c b/test/libc/stdio/getrandom_test.c index b0da64d56..504ff7821 100644 --- a/test/libc/stdio/getrandom_test.c +++ b/test/libc/stdio/getrandom_test.c @@ -243,8 +243,8 @@ uint64_t MobyDick(void) { uint64_t ExecutableImage(void) { static int i; - if ((i += 8) > _end - _base) i = 8; - return READ64LE(_base + i); + if ((i += 8) > _end - __executable_start) i = 8; + return READ64LE(__executable_start + i); } uint32_t SeventhEditionRand(void) { diff --git a/test/libc/str/strlcpy_test.c b/test/libc/str/strlcpy_test.c index 8120d7cd6..5cf8a2864 100644 --- a/test/libc/str/strlcpy_test.c +++ b/test/libc/str/strlcpy_test.c @@ -16,7 +16,10 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/mem/gc.internal.h" +#include "libc/mem/mem.h" #include "libc/str/str.h" +#include "libc/testlib/ezbench.h" #include "libc/testlib/testlib.h" TEST(strlcpy, testEmptyBuffer_doesNothing) { @@ -34,3 +37,11 @@ TEST(strlcpy, testShortBuffer_copies) { EXPECT_EQ(5, strlcpy(buf, "hello", 2)); EXPECT_STREQ("h", buf); } + +BENCH(strlcpy, bench) { + char buf[256]; + EZBENCH2("strlcpy", donothing, + EXPROPRIATE(strlcpy(VEIL("r", buf), "hello there", sizeof(buf)))); + EZBENCH2("strncpy", donothing, + EXPROPRIATE(strncpy(VEIL("r", buf), "hello there", sizeof(buf)))); +} diff --git a/test/libc/tinymath/magicu_test.c b/test/libc/tinymath/magicu_test.c index 50c44e57d..2c19bc0ef 100644 --- a/test/libc/tinymath/magicu_test.c +++ b/test/libc/tinymath/magicu_test.c @@ -17,9 +17,13 @@ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ #include "libc/tinymath/magicu.h" +#include "libc/intrin/kprintf.h" +#include "libc/limits.h" #include "libc/macros.internal.h" +#include "libc/runtime/runtime.h" #include "libc/testlib/ezbench.h" #include "libc/testlib/testlib.h" +#include "libc/tinymath/magicu.h" #define T uint32_t #define TBIT (sizeof(T) * CHAR_BIT - 1) @@ -43,10 +47,10 @@ TEST(magicu, test) { } } -BENCH(cog, bench) { - struct magicu d = __magicu_get(7); - EZBENCH2("__magicu_get", donothing, __magicu_get(VEIL("r", 77))); +BENCH(magicu, bench) { + struct magicu d = __magicu_get(UINT32_MAX); + EZBENCH2("__magicu_get", donothing, __magicu_get(VEIL("r", UINT32_MAX))); EZBENCH2("__magicu_div", donothing, - EXPROPRIATE(__magicu_div(VEIL("r", 77), d))); - EZBENCH2("/", donothing, EXPROPRIATE(VEIL("r", 77) / VEIL("r", 7))); + EXPROPRIATE(__magicu_div(VEIL("r", 77u), d))); + EZBENCH2("/", donothing, EXPROPRIATE(VEIL("r", 77u) / VEIL("r", UINT32_MAX))); } diff --git a/third_party/ggml/quantize.cc b/third_party/ggml/quantize.cc index 1472051bb..eaebc082f 100644 --- a/third_party/ggml/quantize.cc +++ b/third_party/ggml/quantize.cc @@ -41,6 +41,7 @@ asm(".include \"libc/disclaimer.inc\""); // clang-format off static const std::map LLAMA_FTYPE_MAP = { + {"f32", LLAMA_FTYPE_ALL_F32 }, {"f16", LLAMA_FTYPE_MOSTLY_F16 }, {"q4_0", LLAMA_FTYPE_MOSTLY_Q4_0}, {"q4_1", LLAMA_FTYPE_MOSTLY_Q4_1}, diff --git a/third_party/mbedtls/test/lib.c b/third_party/mbedtls/test/lib.c index 545b23d78..e97c7f712 100644 --- a/third_party/mbedtls/test/lib.c +++ b/third_party/mbedtls/test/lib.c @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "third_party/mbedtls/test/lib.h" #include "libc/calls/calls.h" #include "libc/dce.h" #include "libc/fmt/conv.h" @@ -42,7 +43,6 @@ #include "third_party/mbedtls/endian.h" #include "third_party/mbedtls/error.h" #include "third_party/mbedtls/platform.h" -#include "third_party/mbedtls/test/lib.h" asm(".ident\t\"\\n\\n\ Mbed TLS (Apache 2.0)\\n\ diff --git a/third_party/musl/crypt_des.c b/third_party/musl/crypt_des.c index 3b25dc9dd..850272ea1 100644 --- a/third_party/musl/crypt_des.c +++ b/third_party/musl/crypt_des.c @@ -25,9 +25,9 @@ │ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. │ │ │ ╚─────────────────────────────────────────────────────────────────────────────*/ -#include "libc/mem/alg.h" #include "libc/limits.h" #include "libc/literal.h" +#include "libc/mem/alg.h" #include "libc/str/str.h" #include "third_party/musl/crypt.internal.h" #include "third_party/musl/crypt_des.internal.h" @@ -813,7 +813,7 @@ void __do_des(uint32_t l_in, uint32_t r_in, unsigned int round = 16; const uint32_t *kl = ekey->l; const uint32_t *kr = ekey->r; - uint32_t f; + uint32_t f = 0; while (round--) { uint32_t r48l, r48r; /* diff --git a/third_party/python/Modules/faulthandler.c b/third_party/python/Modules/faulthandler.c index 6c4b12196..6924b5bfc 100644 --- a/third_party/python/Modules/faulthandler.c +++ b/third_party/python/Modules/faulthandler.c @@ -102,7 +102,7 @@ static struct { PY_TIMEOUT_T timeout_us; /* timeout in microseconds */ int repeat; PyInterpreterState *interp; - int exit; + int exit_; char *header; size_t header_len; /* The main thread always holds this lock. It is only released when @@ -622,7 +622,7 @@ faulthandler_thread(void *unused) errmsg = _Py_DumpTracebackThreads(thread.fd, thread.interp, NULL); ok = (errmsg == NULL); - if (thread.exit) + if (thread.exit_) _exit(1); } while (ok && thread.repeat); @@ -729,7 +729,7 @@ faulthandler_dump_traceback_later(PyObject *self, thread.timeout_us = timeout_us; thread.repeat = repeat; thread.interp = tstate->interp; - thread.exit = exit; + thread.exit_ = exit; thread.header = header; thread.header_len = header_len; diff --git a/third_party/zip/zipnote.c b/third_party/zip/zipnote.c index fb39c2de5..a3a339036 100644 --- a/third_party/zip/zipnote.c +++ b/third_party/zip/zipnote.c @@ -72,10 +72,6 @@ void zipnoteerr(int c, ZCONST char *h); void zipnotewarn(ZCONST char *a, ZCONST char *b); #endif -#ifdef QDOS -#define exit(p1) QDOSexit() -#endif - int set_filetype(out_path) char *out_path; { diff --git a/third_party/zip/zipsplit.c b/third_party/zip/zipsplit.c index 39474ce7a..725407be9 100644 --- a/third_party/zip/zipsplit.c +++ b/third_party/zip/zipsplit.c @@ -45,7 +45,6 @@ # define INDEX "zipsplit_idx" /* Name of index file */ # define TEMPL_FMT "%%0%dld_zip" # define TEMPL_SIZ 17 -# define exit(p1) QDOSexit() #else #ifdef VM_CMS # define INDEX "zipsplit.idx" /* Name of index file */ diff --git a/third_party/zlib/cpu_features.c b/third_party/zlib/cpu_features.c index ac8f74ba6..84fa43ab8 100644 --- a/third_party/zlib/cpu_features.c +++ b/third_party/zlib/cpu_features.c @@ -19,7 +19,7 @@ #include "libc/dce.h" #include "libc/runtime/runtime.h" #include "libc/sysv/consts/auxv.h" -#include "libc/sysv/consts/hwap.h" +#include "libc/sysv/consts/hwcap.h" #include "third_party/zlib/cpu_features.internal.h" #include "third_party/zlib/zlib.h" diff --git a/tool/build/fixupobj.c b/tool/build/fixupobj.c index e11556dbd..324fcdcd3 100644 --- a/tool/build/fixupobj.c +++ b/tool/build/fixupobj.c @@ -26,9 +26,9 @@ #include "libc/elf/struct/sym.h" #include "libc/errno.h" #include "libc/fmt/itoa.h" -#include "libc/intrin/safemacros.internal.h" #include "libc/log/check.h" #include "libc/log/log.h" +#include "libc/macros.internal.h" #include "libc/runtime/runtime.h" #include "libc/str/str.h" #include "libc/sysv/consts/map.h" @@ -50,6 +50,10 @@ Usage: fixupobj.com [-h] ARGS...\n\ -h show help\n\ " +#define COSMO_TLS_REG 28 +#define MRS_TPIDR_EL0 0xd53bd040u +#define MOV_REG(DST, SRC) (0xaa0003e0u | (SRC) << 16 | (DST)) + void Write(const char *s, ...) { va_list va; va_start(va, s); @@ -67,7 +71,7 @@ wontreturn void SysExit(int rc, const char *call, const char *thing) { FormatInt32(ibuf, err); estr = _strerdoc(err); if (!estr) estr = "EUNKNOWN"; - Write(thing, ": ", call, "() failed: ", estr, " (", ibuf, ")\n", 0); + Write(thing, ": ", call, "() failed: ", estr, " (", ibuf, ")\n", NULL); exit(rc); } @@ -86,10 +90,29 @@ static void GetOpts(int argc, char *argv[]) { } } +// Modify ARM64 code to use x28 for TLS rather than tpidr_el0. +void RewriteTlsCode(Elf64_Ehdr *elf, size_t elfsize) { + int i, dest; + Elf64_Shdr *shdr; + uint32_t *p, *pe; + for (i = 0; i < elf->e_shnum; ++i) { + shdr = GetElfSectionHeaderAddress(elf, elfsize, i); + if (shdr->sh_type == SHT_PROGBITS && // + (shdr->sh_flags & SHF_ALLOC) && // + (shdr->sh_flags & SHF_EXECINSTR) && // + (p = GetElfSectionAddress(elf, elfsize, shdr))) { + for (pe = p + shdr->sh_size / 4; p <= pe; ++p) { + if ((*p & -32) == MRS_TPIDR_EL0) { + *p = MOV_REG(*p & 31, COSMO_TLS_REG); + } + } + } + } +} + void OptimizeRelocations(Elf64_Ehdr *elf, size_t elfsize) { char *strs; Elf64_Half i; - struct Op *op; Elf64_Sym *syms; Elf64_Rela *rela; Elf64_Xword symcount; @@ -107,7 +130,7 @@ void OptimizeRelocations(Elf64_Ehdr *elf, size_t elfsize) { CHECK_NOTNULL((code = GetElfSectionAddress(elf, elfsize, shdrcode))); for (rela = GetElfSectionAddress(elf, elfsize, shdr); ((uintptr_t)rela + shdr->sh_entsize <= - min((uintptr_t)elf + elfsize, + MIN((uintptr_t)elf + elfsize, (uintptr_t)elf + shdr->sh_offset + shdr->sh_size)); ++rela) { @@ -166,7 +189,12 @@ void RewriteObject(const char *path) { 0)) == MAP_FAILED) { SysExit(__COUNTER__ + 1, "mmap", path); } - OptimizeRelocations(elf, st.st_size); + if (elf->e_machine == EM_NEXGEN32E) { + OptimizeRelocations(elf, st.st_size); + } + if (elf->e_machine == EM_AARCH64) { + RewriteTlsCode(elf, st.st_size); + } if (msync(elf, st.st_size, MS_ASYNC | MS_INVALIDATE)) { SysExit(__COUNTER__ + 1, "msync", path); } diff --git a/tool/emacs/cosmo-cpp-constants.el b/tool/emacs/cosmo-cpp-constants.el index ff32dac86..4344af984 100644 --- a/tool/emacs/cosmo-cpp-constants.el +++ b/tool/emacs/cosmo-cpp-constants.el @@ -53,6 +53,7 @@ "__BMI__" "__BMI2__" "__FMA__" + "__FAST_MATH__" "__FMA4__" "__F16C__" "__CLZERO__" diff --git a/tool/hello/hello.c b/tool/hello/hello.c index 3ea5190e2..d84bef4ab 100644 --- a/tool/hello/hello.c +++ b/tool/hello/hello.c @@ -1,5 +1,4 @@ #include "libc/calls/calls.h" -#include "libc/intrin/kprintf.h" #include "libc/str/str.h" // hello world with minimal build system dependencies @@ -9,6 +8,5 @@ static ssize_t Write(int fd, const char *s) { } int main(int argc, char *argv[]) { - Write(1, "hello world\n"); - kprintf("hello world\n"); + Write(1, "hello\n"); } diff --git a/tool/hello/hello.mk b/tool/hello/hello.mk index bb4f9a0fc..e2711b9e2 100644 --- a/tool/hello/hello.mk +++ b/tool/hello/hello.mk @@ -14,6 +14,7 @@ TOOL_HELLO_DIRECTDEPS = \ LIBC_NEXGEN32E \ LIBC_RUNTIME \ LIBC_STR \ + LIBC_SYSV \ LIBC_STUBS TOOL_HELLO_DEPS := \ diff --git a/tool/net/redbean.c b/tool/net/redbean.c index 62bc913ed..ab946471b 100644 --- a/tool/net/redbean.c +++ b/tool/net/redbean.c @@ -16,6 +16,7 @@ │ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │ │ PERFORMANCE OF THIS SOFTWARE. │ ╚─────────────────────────────────────────────────────────────────────────────*/ +#include "ape/sections.internal.h" #include "libc/assert.h" #include "libc/atomic.h" #include "libc/calls/calls.h" @@ -6616,8 +6617,8 @@ static int MemoryMonitor(void *arg, int tid) { intervals = atomic_load_explicit(&_mmi.i, memory_order_relaxed); if ((mi2 = realloc(mi, (intervals += 3) * sizeof(*mi)))) { mi = mi2; - mi[0].x = (intptr_t)_base >> 16; - mi[0].size = _etext - _base; + mi[0].x = (intptr_t)__executable_start >> 16; + mi[0].size = _etext - __executable_start; mi[0].flags = 0; mi[1].x = (intptr_t)_etext >> 16; mi[1].size = _edata - _etext;