Small Binary Toolchain, Linker, And Post-Link Optimization
This page documents the bounded production evidence for small native binaries,
native linker layout, and post-link optimization. It covers section splitting,
dead-code and dead-data elimination, identical code/data folding, symbol
visibility, source-owned linker-script policy, thin whole-program summaries,
profile freshness, relocation-safe post-link layout, stripped artifacts,
debug-capable artifacts, and release size budgets.
Run the bounded gates with:
make tiny-binary-check
make native-linker-check
make native-post-link-check
These gates do not run the full release or self-host matrix. They validate the
source-owned toolchain evidence listed below.
Evidence Files
native-toolchain/schema.tsv;native-toolchain/section-policy.tsv;native-toolchain/linker-script-policy.tsv;native-toolchain/post-link-policy.tsv;native-toolchain/verification-cases.tsv;native-toolchain/fixtures/valid-native-toolchain.json;release/native-toolchain-size-report.tsv;release/native-toolchain-section-report.tsv;release/native-toolchain-symbol-report.tsv;release/native-toolchain-callgraph-report.tsv;release/native-toolchain-profile-report.tsv;release/native-toolchain-post-link-report.tsv;release/native-toolchain-relocations.tsv;release/native-toolchain-thin-summary.tsv;perf/native-toolchain-benchmarks.tsv;compat/native-toolchain-contract.tsv;tools/native-toolchain-check.py.
Tiny Binary Policy
Release-size variants must be built from fine-grained function and data
sections. Unreachable text and data are removed before release artifacts are
accepted. Eligible identical text and readonly data are folded only when the
symbol and section reports record the retained representative.
The gate rejects:
NATIVE_TOOLCHAIN_SIZE_BUDGET
NATIVE_TOOLCHAIN_SYMBOL
NATIVE_TOOLCHAIN_SECTION
release/native-toolchain-size-report.tsv records both stripped and
debug-capable variants where supported. Stripped variants remove non-exported
symbol information. Debug-capable variants keep review/debug metadata and still
must fit the configured budget.
Native Linker Contract
The native linker contract is source owned. Linker scripts or equivalent 0x0
metadata define memory regions, fixed-address sections, output-section mapping,
firmware image placement, and hosted binary placement.
The gate rejects:
NATIVE_TOOLCHAIN_LINKER_SCRIPT
release/native-toolchain-section-report.tsv,
release/native-toolchain-symbol-report.tsv, and
release/native-toolchain-thin-summary.tsv are the release evidence for native
linker layout. Output sections must map existing input sections and memory
regions must not overlap.
Thin Summary And Profile Data
Thin whole-program summary data records cross-module imports, cross-package
inline decisions, devirtualization, and bounded parallel backend work. Profile
data records workload identity, hash, profile kind, age, hot ordering, and cold
split decisions.
The gate rejects stale profile data:
NATIVE_TOOLCHAIN_PROFILE_STALE
Profile absence is not a correctness problem. When profile-guided layout is
used, profile age and hash evidence must be present and current.
Post-Link Layout
Post-link layout may reorder hot code, split cold code, and keep folded code
stable only when relocation evidence exists for every moved symbol.
The gate rejects:
NATIVE_TOOLCHAIN_RELOCATION
release/native-toolchain-post-link-report.tsv records before/after order,
action, relocation evidence, profile hash, and status for each moved symbol.
What This Does Not Overpromise
This page closes native performance Milestone 7 for the recorded hosted native
toolchain evidence. Direct hardware access, bare-metal output, QEMU or
equivalent emulator execution, compile-time incremental builds, and final
release-wide verification remain owned by later milestones.