[PATCH][RFC] readelf: partial support of ZSTD compression

Martin Liška mliska@suse.cz
Tue Nov 29 09:34:00 GMT 2022


On 11/28/22 23:29, Mark Wielaard wrote:
> Hi Martin,
> 
> On Mon, Nov 28, 2022 at 02:16:35PM +0100, Martin Liška wrote:
>> On 10/29/22 00:21, Mark Wielaard wrote:
>>> Although I like to also have compression working.  Then we can also
>>> add support to src/elfcompress, which makes for a good testcase. See
>>> tests/run-compress.sh (which has found some subtle memory issues when
>>> run under valgrind).
>>
>> All right, so I'm preparing a full support for ZSTD (both compression and compression)
>> and I noticed a refactoring would be handy for compress_section function and callers
>> of the function.
>>
>> Note right now, there are basically 3 compression types and process_file
>> function handles basically all combinations of these (3 x 3 options), while adding ZSTD
>> support would make it even more complicated. However, ZSTD will behave very similar to ZLIB
>> (not zlib-gnu), except a different algorithm will be used. Plus, in order to distinguish
>> ZLIB from ZSTD, we need to read GElf_Chdr.
>>
>> So what do you think about the refactoring as the first step?
> 
> Looks good. I would just add a sanity check that chdr.ch_type is of a
> known compression type (it is only checked to be not NONE atm).

Thanks, fixes that and pushed as 6bb3e0b5. Now I can finish working on the ZSTD support.

Cheers,
Martin

> 
> Cheers,
> 
> Mark
> 
> 



More information about the Elfutils-devel mailing list