@@ -2,7 +2,7 @@ use anyhow::Result;
2
2
3
3
use crate :: {
4
4
obj:: { ObjDataKind , ObjInfo , ObjSectionKind , ObjSymbolKind , SymbolIndex } ,
5
- util:: split:: is_linker_generated_label,
5
+ util:: { config :: is_auto_symbol , split:: is_linker_generated_label} ,
6
6
} ;
7
7
8
8
pub fn detect_objects ( obj : & mut ObjInfo ) -> Result < ( ) > {
@@ -134,15 +134,19 @@ pub fn detect_strings(obj: &mut ObjInfo) -> Result<()> {
134
134
StringResult :: None => { }
135
135
StringResult :: String { length, terminated } => {
136
136
let size = if terminated { length + 1 } else { length } ;
137
- if !symbol. size_known || symbol. size == size as u64 {
137
+ if symbol. size == size as u64
138
+ || ( is_auto_symbol ( symbol) && symbol. size > size as u64 )
139
+ {
138
140
let str = String :: from_utf8_lossy ( & data[ ..length] ) ;
139
141
log:: debug!( "Found string '{}' @ {}" , str , symbol. name) ;
140
142
symbols_set. push ( ( symbol_idx, ObjDataKind :: String , size) ) ;
141
143
}
142
144
}
143
145
StringResult :: WString { length, str } => {
144
146
let size = length + 2 ;
145
- if !symbol. size_known || symbol. size == size as u64 {
147
+ if symbol. size == size as u64
148
+ || ( is_auto_symbol ( symbol) && symbol. size > size as u64 )
149
+ {
146
150
log:: debug!( "Found wide string '{}' @ {}" , str , symbol. name) ;
147
151
symbols_set. push ( ( symbol_idx, ObjDataKind :: String16 , size) ) ;
148
152
}
0 commit comments