@@ -680,16 +680,20 @@ fn symbol_section_kind(obj: &Object, symbol: &Symbol) -> SectionKind {
680
680
}
681
681
}
682
682
683
- /// Check if a symbol is a compiler-generated literal like @1234.
683
+ /// Check if a symbol is a compiler-generated symbol like @1234 or _$E1234 .
684
684
fn is_symbol_compiler_generated_literal ( symbol : & Symbol ) -> bool {
685
- if !symbol. name . starts_with ( '@' ) {
686
- return false ;
685
+ if symbol. name . starts_with ( "_$E" ) {
686
+ if symbol. name [ 3 ..] . chars ( ) . all ( char:: is_numeric) {
687
+ return true ;
688
+ }
687
689
}
688
- if !symbol. name [ 1 ..] . chars ( ) . all ( char:: is_numeric) {
689
- // Exclude @stringBase0, @GUARD@, etc.
690
- return false ;
690
+ if symbol. name . starts_with ( '@' ) {
691
+ if symbol. name [ 1 ..] . chars ( ) . all ( char:: is_numeric) {
692
+ // Exclude @stringBase0, @GUARD@, etc.
693
+ return true ;
694
+ }
691
695
}
692
- true
696
+ false
693
697
}
694
698
695
699
fn find_symbol (
@@ -706,7 +710,7 @@ fn find_symbol(
706
710
// Match compiler-generated symbols against each other (e.g. @251 -> @60)
707
711
// If they are in the same section and have the same value
708
712
if is_symbol_compiler_generated_literal ( in_symbol)
709
- && matches ! ( section_kind, SectionKind :: Data | SectionKind :: Bss )
713
+ && matches ! ( section_kind, SectionKind :: Code | SectionKind :: Data | SectionKind :: Bss )
710
714
{
711
715
let mut closest_match_symbol_idx = None ;
712
716
let mut closest_match_percent = 0.0 ;
@@ -721,8 +725,8 @@ fn find_symbol(
721
725
continue ;
722
726
}
723
727
match section_kind {
724
- SectionKind :: Data => {
725
- // For data, pick the first symbol with exactly matching bytes and relocations.
728
+ SectionKind :: Data | SectionKind :: Code => {
729
+ // For code or data, pick the first symbol with exactly matching bytes and relocations.
726
730
// If no symbols match exactly, and `fuzzy_literals` is true, pick the closest
727
731
// plausible match instead.
728
732
if let Ok ( ( left_diff, _right_diff) ) =
0 commit comments