@@ -9,9 +9,9 @@ use super::{gimli, Context, Endian, EndianSlice, Mapping, Stash, Vec};
99use alloc:: sync:: Arc ;
1010use core:: convert:: { TryFrom , TryInto } ;
1111use 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 = "dep:ruzstd" , backtrace_ruzstd ) ) ]
13+ use object :: elf :: ELFCOMPRESS_ZSTD ;
14+ use object :: elf :: { ELFCOMPRESS_ZLIB , ELF_NOTE_GNU , NT_GNU_BUILD_ID , SHF_COMPRESSED } ;
1515use object:: read:: elf:: { CompressionHeader , FileHeader , SectionHeader , SectionTable , Sym } ;
1616use object:: read:: StringTable ;
1717use object:: { BigEndian , Bytes , NativeEndian } ;
@@ -231,6 +231,7 @@ impl<'a> Object<'a> {
231231 decompress_zlib ( data. 0 , buf) ?;
232232 return Some ( buf) ;
233233 }
234+ #[ cfg( any( feature = "dep:ruzstd" , backtrace_ruzstd) ) ]
234235 ELFCOMPRESS_ZSTD => {
235236 let size = usize:: try_from ( header. ch_size ( self . endian ) ) . ok ( ) ?;
236237 let buf = stash. allocate ( size) ;
@@ -357,6 +358,7 @@ fn decompress_zlib(input: &[u8], output: &mut [u8]) -> Option<()> {
357358 }
358359}
359360
361+ #[ cfg( feature = "dep:ruzstd" ) ]
360362fn decompress_zstd ( mut input : & [ u8 ] , mut output : & mut [ u8 ] ) -> Option < ( ) > {
361363 use ruzstd:: frame:: ReadFrameHeaderError ;
362364 use ruzstd:: frame_decoder:: FrameDecoderError ;
0 commit comments