@@ -150,9 +150,9 @@ impl ObjArch for ObjArchArm {
150150 object:: Endianness :: Big => unarm:: Endian :: Big ,
151151 } ;
152152
153- let parse_flags = ParseFlags { ual : config. arm_unified_syntax } ;
153+ let parse_flags = ParseFlags { ual : config. arm_unified_syntax , version } ;
154154
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) ;
156156
157157 let display_options = DisplayOptions {
158158 reg_names : RegNames {
@@ -168,7 +168,7 @@ impl ObjArch for ObjArchArm {
168168 } ,
169169 } ;
170170
171- while let Some ( ( address, op , ins ) ) = parser. next ( ) {
171+ while let Some ( ( address, ins , parsed_ins ) ) = parser. next ( ) {
172172 if let Some ( next) = next_mapping {
173173 let next_address = parser. address ;
174174 if next_address >= next. address {
@@ -190,12 +190,15 @@ impl ObjArch for ObjArchArm {
190190 | RelocationFlags :: Elf { r_type : elf:: R_ARM_PC24 }
191191 | RelocationFlags :: Elf { r_type : elf:: R_ARM_XPC25 }
192192 | 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 ( _) ) ) ;
195197 }
196198 // Data
197199 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 ( _) ) ) ;
199202 }
200203 _ => ( ) ,
201204 }
@@ -204,20 +207,20 @@ impl ObjArch for ObjArchArm {
204207 let ( args, branch_dest) = if reloc. is_some ( ) && parser. mode == ParseMode :: Data {
205208 ( vec ! [ ObjInsArg :: Reloc ] , None )
206209 } else {
207- push_args ( & ins , config, reloc_arg, address, display_options) ?
210+ push_args ( & parsed_ins , config, reloc_arg, address, display_options) ?
208211 } ;
209212
210- ops. push ( op . id ( ) ) ;
213+ ops. push ( ins . opcode_id ( ) ) ;
211214 insts. push ( ObjIns {
212215 address : address as u64 ,
213216 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 ( ) ,
216219 args,
217220 reloc,
218221 branch_dest,
219222 line,
220- formatted : ins . display ( display_options) . to_string ( ) ,
223+ formatted : parsed_ins . display ( display_options) . to_string ( ) ,
221224 orig : None ,
222225 } ) ;
223226 }
@@ -425,7 +428,7 @@ fn push_args(
425428 | Argument :: Shift ( _)
426429 | Argument :: CpsrFlags ( _)
427430 | 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 ( ) ,
429432 ) ) ) ,
430433 }
431434 }
0 commit comments