@@ -150,9 +150,9 @@ impl ObjArch for ObjArchArm {
150
150
object:: Endianness :: Big => unarm:: Endian :: Big ,
151
151
} ;
152
152
153
- let parse_flags = ParseFlags { ual : config. arm_unified_syntax } ;
153
+ let parse_flags = ParseFlags { ual : config. arm_unified_syntax , version } ;
154
154
155
- let mut parser = Parser :: new ( version , first_mapping, start_addr, endian, parse_flags, code) ;
155
+ let mut parser = Parser :: new ( first_mapping, start_addr, endian, parse_flags, code) ;
156
156
157
157
let display_options = DisplayOptions {
158
158
reg_names : RegNames {
@@ -168,7 +168,7 @@ impl ObjArch for ObjArchArm {
168
168
} ,
169
169
} ;
170
170
171
- while let Some ( ( address, op , ins ) ) = parser. next ( ) {
171
+ while let Some ( ( address, ins , parsed_ins ) ) = parser. next ( ) {
172
172
if let Some ( next) = next_mapping {
173
173
let next_address = parser. address ;
174
174
if next_address >= next. address {
@@ -190,12 +190,15 @@ impl ObjArch for ObjArchArm {
190
190
| RelocationFlags :: Elf { r_type : elf:: R_ARM_PC24 }
191
191
| RelocationFlags :: Elf { r_type : elf:: R_ARM_XPC25 }
192
192
| RelocationFlags :: Elf { r_type : elf:: R_ARM_CALL } => {
193
- reloc_arg =
194
- ins. args . iter ( ) . rposition ( |a| matches ! ( a, Argument :: BranchDest ( _) ) ) ;
193
+ reloc_arg = parsed_ins
194
+ . args
195
+ . iter ( )
196
+ . rposition ( |a| matches ! ( a, Argument :: BranchDest ( _) ) ) ;
195
197
}
196
198
// Data
197
199
RelocationFlags :: Elf { r_type : elf:: R_ARM_ABS32 } => {
198
- reloc_arg = ins. args . iter ( ) . rposition ( |a| matches ! ( a, Argument :: UImm ( _) ) ) ;
200
+ reloc_arg =
201
+ parsed_ins. args . iter ( ) . rposition ( |a| matches ! ( a, Argument :: UImm ( _) ) ) ;
199
202
}
200
203
_ => ( ) ,
201
204
}
@@ -204,20 +207,20 @@ impl ObjArch for ObjArchArm {
204
207
let ( args, branch_dest) = if reloc. is_some ( ) && parser. mode == ParseMode :: Data {
205
208
( vec ! [ ObjInsArg :: Reloc ] , None )
206
209
} else {
207
- push_args ( & ins , config, reloc_arg, address, display_options) ?
210
+ push_args ( & parsed_ins , config, reloc_arg, address, display_options) ?
208
211
} ;
209
212
210
- ops. push ( op . id ( ) ) ;
213
+ ops. push ( ins . opcode_id ( ) ) ;
211
214
insts. push ( ObjIns {
212
215
address : address as u64 ,
213
216
size : ( parser. address - address) as u8 ,
214
- op : op . id ( ) ,
215
- mnemonic : ins . mnemonic . to_string ( ) ,
217
+ op : ins . opcode_id ( ) ,
218
+ mnemonic : parsed_ins . mnemonic . to_string ( ) ,
216
219
args,
217
220
reloc,
218
221
branch_dest,
219
222
line,
220
- formatted : ins . display ( display_options) . to_string ( ) ,
223
+ formatted : parsed_ins . display ( display_options) . to_string ( ) ,
221
224
orig : None ,
222
225
} ) ;
223
226
}
@@ -425,7 +428,7 @@ fn push_args(
425
428
| Argument :: Shift ( _)
426
429
| Argument :: CpsrFlags ( _)
427
430
| Argument :: Endian ( _) => args. push ( ObjInsArg :: Arg ( ObjInsArgValue :: Opaque (
428
- arg. display ( display_options) . to_string ( ) . into ( ) ,
431
+ arg. display ( display_options, None ) . to_string ( ) . into ( ) ,
429
432
) ) ) ,
430
433
}
431
434
}
0 commit comments