File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,22 @@ pub fn diff_bss_symbol(
35
35
) )
36
36
}
37
37
38
+ fn symbol_name_matches ( left_name : & str , right_name : & str ) -> bool {
39
+ // Match Metrowerks symbol$1234 against symbol$2345
40
+ if let Some ( ( prefix, suffix) ) = left_name. split_once ( '$' ) {
41
+ if !suffix. chars ( ) . all ( char:: is_numeric) {
42
+ return false ;
43
+ }
44
+ if let Some ( ( p, s) ) = right_name. split_once ( '$' ) {
45
+ prefix == p && s. chars ( ) . all ( char:: is_numeric)
46
+ } else {
47
+ false
48
+ }
49
+ } else {
50
+ left_name == right_name
51
+ }
52
+ }
53
+
38
54
fn reloc_eq (
39
55
left_obj : & Object ,
40
56
right_obj : & Object ,
@@ -45,8 +61,8 @@ fn reloc_eq(
45
61
return false ;
46
62
}
47
63
48
- let symbol_name_addend_matches =
49
- left . symbol . name == right . symbol . name && left. relocation . addend == right. relocation . addend ;
64
+ let symbol_name_addend_matches = symbol_name_matches ( & left . symbol . name , & right . symbol . name )
65
+ && left. relocation . addend == right. relocation . addend ;
50
66
match ( left. symbol . section , right. symbol . section ) {
51
67
( Some ( sl) , Some ( sr) ) => {
52
68
// Match if section and name+addend or address match
You can’t perform that action at this time.
0 commit comments