MCPcopy Index your code
hub / github.com/encounter/objdiff / is_local_label

Function is_local_label

objdiff-core/src/obj/read.rs:281–286  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
281fn 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
288fn 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.

Callers 1

infer_symbol_sizesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected