File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -64,13 +64,13 @@ impl ObjArchMips {
64
64
// Parse the ri_gp_value stored in .reginfo to be able to correctly
65
65
// calculate R_MIPS_GPREL16 relocations later. The value is stored
66
66
// 0x14 bytes into .reginfo (on 32 bit platforms)
67
- let ri_gp_value = match object. section_by_name ( ".reginfo" ) . and_then ( |s| s . data ( ) . ok ( ) ) {
68
- Some ( reginfo) => {
69
- let gp_ri_value_bytes = reginfo [ 0x14 .. 0x18 ] . try_into ( ) . unwrap_or ( [ 0u8 ; 4 ] ) ;
70
- object . endianness ( ) . read_i32_bytes ( gp_ri_value_bytes )
71
- }
72
- None => 0 ,
73
- } ;
67
+ let ri_gp_value = object
68
+ . section_by_name ( ". reginfo" )
69
+ . and_then ( |section| section . data ( ) . ok ( ) )
70
+ . and_then ( |data| data . get ( 0x14 .. 0x18 ) )
71
+ . and_then ( |s| s . try_into ( ) . ok ( ) )
72
+ . map ( |bytes| object . endianness ( ) . read_i32_bytes ( bytes ) )
73
+ . unwrap_or ( 0 ) ;
74
74
75
75
Ok ( Self { endianness : object. endianness ( ) , abi, instr_category, ri_gp_value } )
76
76
}
You can’t perform that action at this time.
0 commit comments