@@ -680,16 +680,16 @@ fn symbol_section_kind(obj: &Object, symbol: &Symbol) -> SectionKind {
680680 }
681681}
682682
683- /// Check if a symbol is a compiler-generated literal like @1234.
684- fn is_symbol_compiler_generated_literal ( symbol : & Symbol ) -> bool {
685- if !symbol. name . starts_with ( '@' ) {
686- return false ;
687- }
688- if !symbol. name [ 1 ..] . chars ( ) . all ( char:: is_numeric) {
683+ /// Check if a symbol is a compiler-generated like @1234 or _$E1234.
684+ fn is_symbol_compiler_generated ( symbol : & Symbol ) -> bool {
685+ if symbol. name . starts_with ( '@' ) && symbol. name [ 1 ..] . chars ( ) . all ( char:: is_numeric) {
689686 // Exclude @stringBase0, @GUARD@, etc.
690- return false ;
687+ return true ;
688+ }
689+ if symbol. name . starts_with ( "_$E" ) && symbol. name [ 3 ..] . chars ( ) . all ( char:: is_numeric) {
690+ return true ;
691691 }
692- true
692+ false
693693}
694694
695695fn find_symbol (
@@ -705,8 +705,8 @@ fn find_symbol(
705705
706706 // Match compiler-generated symbols against each other (e.g. @251 -> @60)
707707 // If they are in the same section and have the same value
708- if is_symbol_compiler_generated_literal ( in_symbol)
709- && matches ! ( section_kind, SectionKind :: Data | SectionKind :: Bss )
708+ if is_symbol_compiler_generated ( in_symbol)
709+ && matches ! ( section_kind, SectionKind :: Code | SectionKind :: Data | SectionKind :: Bss )
710710 {
711711 let mut closest_match_symbol_idx = None ;
712712 let mut closest_match_percent = 0.0 ;
@@ -717,12 +717,12 @@ fn find_symbol(
717717 if obj. sections [ section_index] . name != section_name {
718718 continue ;
719719 }
720- if !is_symbol_compiler_generated_literal ( symbol) {
720+ if !is_symbol_compiler_generated ( symbol) {
721721 continue ;
722722 }
723723 match section_kind {
724- SectionKind :: Data => {
725- // For data, pick the first symbol with exactly matching bytes and relocations.
724+ SectionKind :: Data | SectionKind :: Code => {
725+ // For code or data, pick the first symbol with exactly matching bytes and relocations.
726726 // If no symbols match exactly, and `fuzzy_literals` is true, pick the closest
727727 // plausible match instead.
728728 if let Ok ( ( left_diff, _right_diff) ) =
0 commit comments