Skip to content

Commit a06d345

Browse files
authored
Ignore extern differences in relocations (#258)
1 parent fbdaa89 commit a06d345

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

objdiff-core/src/diff/code.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use super::{
1414
};
1515
use crate::obj::{
1616
InstructionArg, InstructionArgValue, InstructionRef, Object, ResolvedInstructionRef,
17-
ResolvedRelocation, ResolvedSymbol, SymbolFlag, SymbolKind,
17+
ResolvedRelocation, ResolvedSymbol, SymbolKind,
1818
};
1919

2020
pub fn no_diff_code(
@@ -333,11 +333,7 @@ fn reloc_eq(
333333
|| display_ins_data_literals(left_obj, left_ins)
334334
== display_ins_data_literals(right_obj, right_ins))
335335
}
336-
(None, Some(_)) => {
337-
// Match if possibly stripped weak symbol
338-
symbol_name_addend_matches && right_reloc.symbol.flags.contains(SymbolFlag::Weak)
339-
}
340-
(Some(_), None) | (None, None) => symbol_name_addend_matches,
336+
(Some(_), None) | (None, Some(_)) | (None, None) => symbol_name_addend_matches,
341337
}
342338
}
343339

objdiff-core/src/diff/data.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,7 @@ fn reloc_eq(
6767
section_name_eq(left_obj, right_obj, sl, sr)
6868
&& (symbol_name_addend_matches || address_eq(left, right))
6969
}
70-
(None, Some(_)) => {
71-
// Match if possibly stripped weak symbol
72-
symbol_name_addend_matches && right.symbol.flags.contains(SymbolFlag::Weak)
73-
}
74-
(Some(_), None) | (None, None) => symbol_name_addend_matches,
70+
(Some(_), None) | (None, Some(_)) | (None, None) => symbol_name_addend_matches,
7571
}
7672
}
7773

0 commit comments

Comments
 (0)