[functions] section allows you to manually specify function boundaries, override auto-generated names, and define discontinuous code chunks.
Function Definition
Functions are defined using hexadecimal address keys:FunctionConfig Structure
Fromconfig.h:42-54:
Explicit size of the function in bytes. Mutually exclusive with
end.End address of the function (exclusive). Mutually exclusive with
size.Must be greater than the start address. The function size is calculated as end - address.Custom symbol name for the function. If not specified, auto-generates
sub_XXXXXXXX format.Parent function address for discontinuous chunks. When non-zero, this entry is a chunk belonging to the parent function.Use this for functions with non-contiguous code regions (e.g., cold/hot path separation).
Size vs End
You must specify eithersize or end, but not both:
Discontinuous Chunks
Some compilers split functions into multiple non-contiguous regions. Use theparent field to define chunks:
- Chunks have
parent != 0 - Chunks are not entry points themselves
- Multiple chunks can belong to the same parent
- Chunks can overlap with other functions (parent function boundaries)
- Standalone functions cannot overlap
Validation Rules
Fromconfig.cpp:100-124 and config.cpp:289-350:
Address Alignment
All function addresses must be 4-byte aligned (PowerPC instruction size):Mutual Exclusivity
Cannot specify bothsize and end:
End Address Constraint
When usingend, it must be greater than the start address:
No Overlapping Boundaries
Standalone functions (non-chunks) cannot overlap:Common Patterns
Override Auto-Detection
Force specific boundaries when analysis is incorrect:Split Functions
Handle hot/cold code splitting:Name Important Functions
Example Configuration
See Also
- Codegen Config - Main TOML reference
- Hooks - Mid-assembly hook configuration