code wiki / (root) / nx_size.nx

nx_size.nx

buildroot/runtime/nx_size.nx

4772 B142 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_size.nx -- sovereign `size` tool (binutils equivalent). Reports section sizes in the standard sysv format: text data bss dec hex filename 1024 256 512 1792 0x700 my_program.elf 'text' = ALLOCATED + EXECUTABLE bytes (.text + .rodata) 'data' = ALLOCATED + WRITABLE bytes (.data) 'bss' = ALLOCATED + NOBITS bytes (.bss) 'dec' = sum 'hex' = same in hex Useful for tracking binary bloat over commits + verifying that stripping or DCE actually shrank what we expected. Pairs with nx_objdump / nx_nm / nx_readelf as the size-focused inspection tool.

dependencies 3 imports · 0 importers

syscalls.nx nx_elf_read.nx nx_strfmt.nx nx_size.nx

imports: syscalls.nxnx_elf_read.nxnx_strfmt.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nx_size_report nx_elf_parse_header nx_elf_get_u16_le nx_elf_get_u64_le nx_elf_get_u32_le nx_elf_read_shdr nx_elf_get_u32_le ↻ nx_elf_get_u64_le ↻

structs

38struct NxSizeReport

consts

29const NX_MAGIC_1024: i64 = 1024
32const NX_SIZE_SHF_WRITE: i64 = 0x1
33const NX_SIZE_SHF_ALLOC: i64 = 0x2
34const NX_SIZE_SHF_EXECINSTR: i64 = 0x4
36const NX_SIZE_SHT_NOBITS: i64 = 8
44const NX_SIZE_REPORT_BYTES: i64 = 24

functions

46func nx_size_report(buf: *u8, len: i64) -> *NxSizeReport
82func nx_size_print(buf: *u8, len: i64, fname: *u8, fd: i64) -> i64
102func main() -> i64
calls 1: nx_size_report