@@ -9,9 +9,9 @@ use super::{gimli, Context, Endian, EndianSlice, Mapping, Stash, Vec};
9
9
use alloc:: sync:: Arc ;
10
10
use core:: convert:: { TryFrom , TryInto } ;
11
11
use core:: str;
12
- use object :: elf :: {
13
- ELFCOMPRESS_ZLIB , ELFCOMPRESS_ZSTD , ELF_NOTE_GNU , NT_GNU_BUILD_ID , SHF_COMPRESSED ,
14
- } ;
12
+ # [ cfg ( any ( feature = "zstd" , backtrace_ruzstd ) ) ]
13
+ use object :: elf :: ELFCOMPRESS_ZSTD ;
14
+ use object :: elf :: { ELFCOMPRESS_ZLIB , ELF_NOTE_GNU , NT_GNU_BUILD_ID , SHF_COMPRESSED } ;
15
15
use object:: read:: elf:: { CompressionHeader , FileHeader , SectionHeader , SectionTable , Sym } ;
16
16
use object:: read:: StringTable ;
17
17
use object:: { BigEndian , Bytes , NativeEndian } ;
@@ -231,6 +231,7 @@ impl<'a> Object<'a> {
231
231
decompress_zlib ( data. 0 , buf) ?;
232
232
return Some ( buf) ;
233
233
}
234
+ #[ cfg( any( feature = "zstd" , backtrace_ruzstd) ) ]
234
235
ELFCOMPRESS_ZSTD => {
235
236
let size = usize:: try_from ( header. ch_size ( self . endian ) ) . ok ( ) ?;
236
237
let buf = stash. allocate ( size) ;
@@ -357,6 +358,7 @@ fn decompress_zlib(input: &[u8], output: &mut [u8]) -> Option<()> {
357
358
}
358
359
}
359
360
361
+ #[ cfg( any( feature = "zstd" , backtrace_ruzstd) ) ]
360
362
fn decompress_zstd ( mut input : & [ u8 ] , mut output : & mut [ u8 ] ) -> Option < ( ) > {
361
363
use ruzstd:: frame:: ReadFrameHeaderError ;
362
364
use ruzstd:: frame_decoder:: FrameDecoderError ;
0 commit comments