Bytecode stage
After linking, tare-opt works on the sBPF program itself, as the validator will load it.
The stage
The front stage decides what code the Anchor language generates. The bytecode stage then reads the linked ELF, where code from every crate has been joined: its sections, symbols, relocations and instructions. It runs the real loader and verifier on the program before and after.
What a rewrite must keep
- Section offsets, symbols and relocation sites.
- Syscall hashes and call addresses.
- Every possible target of an indirect call.
What it reports
The build prints the count of instructions rewritten and the size before and after. The full counters and both hashes are in target/tare/optimization.json and in the weighing. The passes