Skip to content

Commit 0c2e825

Browse files
committed
Adjust symbol name matching logic for GCC
1 parent 8f5519c commit 0c2e825

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

objdiff-core/src/diff/data.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ pub fn diff_bss_symbol(
3737

3838
pub fn symbol_name_matches(left_name: &str, right_name: &str) -> bool {
3939
// Match Metrowerks symbol$1234 against symbol$2345
40-
if let Some((prefix, suffix)) = left_name.split_once('$') {
40+
// and GCC symbol.1234 against symbol.2345
41+
if let Some((prefix, suffix)) = left_name.split_once(|c| c == '$' || c == '.') {
4142
if !suffix.chars().all(char::is_numeric) {
4243
return false;
4344
}
4445
right_name
45-
.split_once('$')
46+
.split_once(|c| c == '$' || c == '.')
4647
.is_some_and(|(p, s)| p == prefix && s.chars().all(char::is_numeric))
4748
} else {
4849
left_name == right_name

0 commit comments

Comments
 (0)