nx_elf_inspect.nx
buildroot/runtime/nx_elf_inspect.nx
about
nx_elf_inspect.nx -- SOVEREIGN ELF inspector: answers "is this binary truly sovereign?" = statically linked
with ZERO dynamic dependencies, WITHOUT the shell tools `file` + `readelf`. Parses the ELF64 program-header
table for a PT_INTERP (an interpreter => dynamically linked) and a PT_DYNAMIC segment, then walks the dynamic
array for DT_NEEDED (shared-library) entries. This is the crux capability for the bench/gate_nx_sovereign_deps.sh
gate (which uses `file | grep "statically linked"` + `readelf -d | grep NEEDED`) and, broadly, the binary-level
sovereignty check the ecosystem lacked (source-scan proves no lib REFERENCES; this proves the shipped ELF has
no lib DEPENDENCIES). Sovereign (syscalls only). license_tier: ORIGINAL expect_exit: 0 (on a static ELF)
Usage: nx_elf_inspect <file> -- exit 0 = STATIC/sovereign (no interpreter, 0 NEEDED); exit 1 = DYNAMIC.
dependencies 1 imports · 0 importers
imports: nx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 12 | const EI_CAP: i64 = 16777216 // 16 MiB read cap (organ + system binaries are well under this) |
functions
| 14 | func ei_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 15 | func ei_putn(v: i64) -> i64 |
| 26 | func ei_read_file(path: *u8, buf: *u8, cap: i64) -> i64 |
| 40 | func ei_u16(buf: *u8, o: i64) -> i64 { return (buf[o] as i64) | ((buf[o + 1] as i64) << 8) } called by 1: main |
| 41 | func ei_u32(buf: *u8, o: i64) -> i64 called by 1: main |
| 44 | func ei_u64(buf: *u8, o: i64) -> i64 called by 1: main |
| 50 | func main(argc: i64, argv: *i64) -> i64 |