File tree Expand file tree Collapse file tree 4 files changed +14
-29
lines changed Expand file tree Collapse file tree 4 files changed +14
-29
lines changed Original file line number Diff line number Diff line change @@ -48,13 +48,10 @@ impl ObjArchArm {
48
48
s. kind ( ) == SectionKind :: Elf ( SHT_ARM_ATTRIBUTES ) && s. name ( ) == Ok ( ".ARM.attributes" )
49
49
} ) {
50
50
let attr_data = arm_attrs. uncompressed_data ( ) ?;
51
- let build_attrs = BuildAttrs :: new (
52
- & attr_data,
53
- match file. endianness ( ) {
54
- object:: Endianness :: Little => arm_attr:: Endian :: Little ,
55
- object:: Endianness :: Big => arm_attr:: Endian :: Big ,
56
- } ,
57
- ) ?;
51
+ let build_attrs = BuildAttrs :: new ( & attr_data, match file. endianness ( ) {
52
+ object:: Endianness :: Little => arm_attr:: Endian :: Little ,
53
+ object:: Endianness :: Big => arm_attr:: Endian :: Big ,
54
+ } ) ?;
58
55
for subsection in build_attrs. subsections ( ) {
59
56
let subsection = subsection?;
60
57
if !subsection. is_aeabi ( ) {
Original file line number Diff line number Diff line change @@ -36,15 +36,11 @@ pub trait ObjArch: Send + Sync {
36
36
reloc : & Relocation ,
37
37
) -> Result < i64 > ;
38
38
39
- fn demangle ( & self , _name : & str ) -> Option < String > {
40
- None
41
- }
39
+ fn demangle ( & self , _name : & str ) -> Option < String > { None }
42
40
43
41
fn display_reloc ( & self , flags : RelocationFlags ) -> Cow < ' static , str > ;
44
42
45
- fn symbol_address ( & self , symbol : & Symbol ) -> u64 {
46
- symbol. address ( )
47
- }
43
+ fn symbol_address ( & self , symbol : & Symbol ) -> u64 { symbol. address ( ) }
48
44
}
49
45
50
46
pub struct ProcessCodeResult {
Original file line number Diff line number Diff line change @@ -20,16 +20,12 @@ fn is_rel_abs_arg(arg: &Argument) -> bool {
20
20
matches ! ( arg, Argument :: Uimm ( _) | Argument :: Simm ( _) | Argument :: Offset ( _) )
21
21
}
22
22
23
- fn is_offset_arg ( arg : & Argument ) -> bool {
24
- matches ! ( arg, Argument :: Offset ( _) )
25
- }
23
+ fn is_offset_arg ( arg : & Argument ) -> bool { matches ! ( arg, Argument :: Offset ( _) ) }
26
24
27
25
pub struct ObjArchPpc { }
28
26
29
27
impl ObjArchPpc {
30
- pub fn new ( _file : & File ) -> Result < Self > {
31
- Ok ( Self { } )
32
- }
28
+ pub fn new ( _file : & File ) -> Result < Self > { Ok ( Self { } ) }
33
29
}
34
30
35
31
impl ObjArch for ObjArchPpc {
Original file line number Diff line number Diff line change @@ -262,12 +262,9 @@ impl FormatterOutput for InstructionFormatterOutput {
262
262
match kind {
263
263
FormatterTextKind :: LabelAddress => {
264
264
if let Some ( reloc) = self . ins . reloc . as_ref ( ) {
265
- if matches ! (
266
- reloc. flags,
267
- RelocationFlags :: Coff {
268
- typ: pe:: IMAGE_REL_I386_DIR32 | pe:: IMAGE_REL_I386_REL32
269
- }
270
- ) {
265
+ if matches ! ( reloc. flags, RelocationFlags :: Coff {
266
+ typ: pe:: IMAGE_REL_I386_DIR32 | pe:: IMAGE_REL_I386_REL32
267
+ } ) {
271
268
self . ins . args . push ( ObjInsArg :: Reloc ) ;
272
269
return ;
273
270
} else if self . error . is_none ( ) {
@@ -283,10 +280,9 @@ impl FormatterOutput for InstructionFormatterOutput {
283
280
}
284
281
FormatterTextKind :: FunctionAddress => {
285
282
if let Some ( reloc) = self . ins . reloc . as_ref ( ) {
286
- if matches ! (
287
- reloc. flags,
288
- RelocationFlags :: Coff { typ: pe:: IMAGE_REL_I386_REL32 }
289
- ) {
283
+ if matches ! ( reloc. flags, RelocationFlags :: Coff {
284
+ typ: pe:: IMAGE_REL_I386_REL32
285
+ } ) {
290
286
self . ins . args . push ( ObjInsArg :: Reloc ) ;
291
287
return ;
292
288
} else if self . error . is_none ( ) {
You can’t perform that action at this time.
0 commit comments