When inferring a symbol's size, we ignore symbols that start with specific prefixes. They are usually emitted as branch targets and do not represent the start of a function or object.
(symbol: &Symbol)
| 279 | /// When inferring a symbol's size, we ignore symbols that start with specific prefixes. They are |
| 280 | /// usually emitted as branch targets and do not represent the start of a function or object. |
| 281 | fn is_local_label(symbol: &Symbol) -> bool { |
| 282 | const LABEL_PREFIXES: &[&str] = &[".L", "LAB_", "switchD_"]; |
| 283 | symbol.size == 0 |
| 284 | && symbol.flags.contains(SymbolFlag::Local) |
| 285 | && LABEL_PREFIXES.iter().any(|p| symbol.name.starts_with(p)) |
| 286 | } |
| 287 | |
| 288 | fn infer_symbol_sizes(arch: &dyn Arch, symbols: &mut [Symbol], sections: &[Section]) -> Result<()> { |
| 289 | // Above, we've sorted the symbols by section and then by address. |
no outgoing calls
no test coverage detected