mirror of
https://github.com/encounter/objdiff.git
synced 2025-06-05 14:13:45 +00:00
Use symbol name when comparing against an externed reloc (#214)
* Use symbol name when comparing against an externed reloc For partial matching files, often a symbol is externed even though it should exist in the target object. We can still compare the symbol name, instead of always returning a mismatch. * Combine cases, and apply change reloc_eq in code.rs
This commit is contained in:
parent
e9762e24c2
commit
f58616b6dd
@ -325,12 +325,11 @@ fn reloc_eq(
|
||||
|| display_ins_data_literals(left_obj, left_ins)
|
||||
== display_ins_data_literals(right_obj, right_ins))
|
||||
}
|
||||
(Some(_), None) => false,
|
||||
(None, Some(_)) => {
|
||||
// Match if possibly stripped weak symbol
|
||||
symbol_name_addend_matches && right_reloc.symbol.flags.contains(SymbolFlag::Weak)
|
||||
}
|
||||
(None, None) => symbol_name_addend_matches,
|
||||
(Some(_), None) | (None, None) => symbol_name_addend_matches,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,12 +53,11 @@ fn reloc_eq(
|
||||
section_name_eq(left_obj, right_obj, sl, sr)
|
||||
&& (symbol_name_addend_matches || address_eq(left, right))
|
||||
}
|
||||
(Some(_), None) => false,
|
||||
(None, Some(_)) => {
|
||||
// Match if possibly stripped weak symbol
|
||||
symbol_name_addend_matches && right.symbol.flags.contains(SymbolFlag::Weak)
|
||||
}
|
||||
(None, None) => symbol_name_addend_matches,
|
||||
(Some(_), None) | (None, None) => symbol_name_addend_matches,
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user