Skip to content

Commit e4dc9f3

Browse files
committed
[DWARF Import] Do not link functions without addresses to externs
1 parent 4149752 commit e4dc9f3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

plugins/dwarf/dwarf_import/src/dwarfdebuginfo.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,9 @@ impl DebugInfoBuilder {
720720
// Link mangled names without addresses to existing symbols in the binary
721721
if func.address.is_none() && func.raw_name.is_some() {
722722
// DWARF doesn't contain GOT info, so remove any entries there...they will be wrong (relying on Binja's mechanisms for the GOT is good )
723-
if symbol.sym_type() != SymbolType::ImportAddress {
723+
// Also ignore externs since we don't want to try and create functions not backed by the file
724+
let symbol_type = symbol.sym_type();
725+
if symbol_type != SymbolType::ImportAddress && symbol_type != SymbolType::External {
724726
func.address = Some(symbol.address() - bv.start());
725727
}
726728
}

0 commit comments

Comments
 (0)