Skip to content

Commit 67b237e

Browse files
authored
Adjust symbol name matching logic for GCC (#278)
* Adjust symbol name matching logic for GCC * Turn $ and . into a list * Fix borrow issue
1 parent 66da80f commit 67b237e

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(['$', '.']) {
4142
if !suffix.chars().all(char::is_numeric) {
4243
return false;
4344
}
4445
right_name
45-
.split_once('$')
46+
.split_once(['$', '.'])
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)