@@ -12,7 +12,6 @@ use super::SymbolName;
1212use addr2line:: gimli;
1313use core:: convert:: TryInto ;
1414use core:: mem;
15- use core:: u32;
1615use libc:: c_void;
1716use mystd:: ffi:: OsString ;
1817use mystd:: fs:: File ;
@@ -100,7 +99,7 @@ impl Mapping {
10099 // only borrow `map` and `stash` and we're preserving them below.
101100 cx : unsafe { core:: mem:: transmute :: < Context < ' _ > , Context < ' static > > ( cx) } ,
102101 _map : data,
103- stash : stash ,
102+ stash,
104103 } )
105104 }
106105}
@@ -119,16 +118,18 @@ impl<'data> Context<'data> {
119118 dwp : Option < Object < ' data > > ,
120119 ) -> Option < Context < ' data > > {
121120 let mut sections = gimli:: Dwarf :: load ( |id| -> Result < _ , ( ) > {
122- if cfg ! ( not( target_os = "aix" ) ) {
121+ #[ cfg( not( target_os = "aix" ) ) ]
122+ {
123123 let data = object. section ( stash, id. name ( ) ) . unwrap_or ( & [ ] ) ;
124124 Ok ( EndianSlice :: new ( data, Endian ) )
125+ }
126+
127+ #[ cfg( target_os = "aix" ) ]
128+ if let Some ( name) = id. xcoff_name ( ) {
129+ let data = object. section ( stash, name) . unwrap_or ( & [ ] ) ;
130+ Ok ( EndianSlice :: new ( data, Endian ) )
125131 } else {
126- if let Some ( name) = id. xcoff_name ( ) {
127- let data = object. section ( stash, name) . unwrap_or ( & [ ] ) ;
128- Ok ( EndianSlice :: new ( data, Endian ) )
129- } else {
130- Ok ( EndianSlice :: new ( & [ ] , Endian ) )
131- }
132+ Ok ( EndianSlice :: new ( & [ ] , Endian ) )
132133 }
133134 } )
134135 . ok ( ) ?;
@@ -336,7 +337,7 @@ impl Cache {
336337 // never happen, and symbolicating backtraces would be ssssllllooooowwww.
337338 static mut MAPPINGS_CACHE : Option < Cache > = None ;
338339
339- f ( MAPPINGS_CACHE . get_or_insert_with ( || Cache :: new ( ) ) )
340+ f ( MAPPINGS_CACHE . get_or_insert_with ( Cache :: new) )
340341 }
341342
342343 fn avma_to_svma ( & self , addr : * const u8 ) -> Option < ( usize , * const u8 ) > {
0 commit comments