aya: don't parse labels as programs

Fixes a bug introduced by https://github.com/aya-rs/aya/pull/413 where
we were generating a bunch of spurious LBB* programs.
pull/737/head
Alessandro Decina 11 months ago
parent d679a973ca
commit 35e21ae007

@ -599,12 +599,12 @@ impl Object {
.get(symbol_index) .get(symbol_index)
.expect("all symbols in symbols_by_section are also in symbol_table"); .expect("all symbols in symbols_by_section are also in symbol_table");
let Some(name) = symbol.name.as_ref() else { // Here we get both ::Label (LBB*) and ::Text symbols, and we only want the latter.
continue; let name = match (symbol.name.as_ref(), symbol.kind) {
(Some(name), SymbolKind::Text) if !name.is_empty() => name,
_ => continue,
}; };
if name.is_empty() {
continue;
}
let (p, f) = let (p, f) =
self.parse_program(section, program_section.clone(), name.to_string(), symbol)?; self.parse_program(section, program_section.clone(), name.to_string(), symbol)?;
let key = p.function_key(); let key = p.function_key();

Loading…
Cancel
Save