boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

LIBC.txt (2295B)


      1 # Unresolved external-linkage symbols required to link tcc-boot2.
      2 # Sorted set difference of `&ref` vs `:def` lines in the linked.hex2
      3 # produced by `make tcc-boot2 ARCH=aarch64`. Refresh with:
      4 #   scripts/boot-undef.sh > /tmp/raw && diff /tmp/raw docs/LIBC.txt
      5 #
      6 # Split by whether the implementation can be straight C/asm or needs a
      7 # Linux syscall — the right column names which one(s).
      8 #
      9 # Notes:
     10 #   - errno is data, not code: a single global int that the syscall
     11 #     wrappers must set on failure. Listed under syscall-using because
     12 #     wiring it up is part of the same layer.
     13 #   - `free`/`realloc` can be pure if the allocator never returns
     14 #     pages to the kernel (free-list only); listed under syscall-using
     15 #     because a usable libc allocator usually needs brk or mmap.
     16 #   - The f-family (fopen/fclose/fread/fwrite/...) wraps an internal
     17 #     FILE struct over fd-based syscalls. Each entry's syscall column
     18 #     names the underlying syscall, not the FILE bookkeeping.
     19 
     20 # pure code (no syscalls)
     21 atoi
     22 memmove
     23 qsort
     24 snprintf
     25 sprintf
     26 strchr
     27 strcpy
     28 strncmp
     29 strrchr
     30 strstr
     31 strtof
     32 strtol
     33 strtoul
     34 strtoull
     35 vsnprintf
     36 
     37 # syscall-using (or runtime data)
     38 __assert_fail      write + exit_group
     39 abort              exit_group        (or rt_sigprocmask + kill SIGABRT)
     40 close              close
     41 errno              (data — set by syscall wrappers on failure)
     42 execvp             execve            (+ access / faccessat for PATH lookup)
     43 exit               exit_group
     44 fclose             close + write     (write to flush any buffered output)
     45 fdopen             —                 (allocates FILE; transitively malloc -> brk/mmap)
     46 fflush             write
     47 fopen              open              (or openat)
     48 fprintf            write
     49 fputc              write
     50 fputs              write
     51 fread              read
     52 free               brk or mmap/munmap (allocator-dependent)
     53 fseek              lseek
     54 ftell              lseek             (SEEK_CUR, off=0)
     55 fwrite             write
     56 lseek              lseek
     57 malloc             brk or mmap
     58 open               open              (or openat)
     59 printf             write
     60 read               read
     61 realloc            brk or mmap       (or pure if grown in place)
     62 remove             unlink            (or unlinkat)
     63 unlink             unlink            (or unlinkat)