From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 9CCEF3858407 for ; Tue, 29 Nov 2022 09:34:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9CCEF3858407 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id CED9D1FDDE; Tue, 29 Nov 2022 09:34:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1669714440; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GBvHLEZDrnpxNac7RMK7zedM7Izzyn5IfH3U/POz0T4=; b=J3aOdHJKn+zvwJ2mIfVlbr6eIj4Iqjq+JH/cu47HbjI8tFH5GCrq2gI9eOvc/hGNLdCzL7 I2fw+PwCxiIwsEynloWPIPlDStNw+pwjqyfRPHKRaPCcIfSmIfccREwiLSV5ciS+YnUWaT cqc4njTTdz/o5MuYFhXqpB1Oj2HG4e4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1669714440; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GBvHLEZDrnpxNac7RMK7zedM7Izzyn5IfH3U/POz0T4=; b=3/QMlURQqui8qk8qTgqBYRGJXYkwqPVO2uSjzI2ugpS9OHalWIL1dLsBs3/vzt1DkHTtE1 TSIam4U4hwgeOjAw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id B401213428; Tue, 29 Nov 2022 09:34:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id CCH0KgjShWNxJgAAMHmgww (envelope-from ); Tue, 29 Nov 2022 09:34:00 +0000 Message-ID: <24d7165b-b8ac-ea5d-a046-aec2203696a9@suse.cz> Date: Tue, 29 Nov 2022 10:34:00 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH][RFC] readelf: partial support of ZSTD compression Content-Language: en-US To: Mark Wielaard Cc: "Dmitry V. Levin" , elfutils-devel@sourceware.org, Fangrui Song References: <542eb279-d15d-6f17-02c0-c53fd0f33055@suse.cz> <20221024114137.GA19251@altlinux.org> <0375dd0c-2410-d1ca-8ce7-41293e8e2fa2@suse.cz> <20221024164806.GA21412@altlinux.org> <6c1ce1f1-2e45-20bb-e98d-6d35692addfb@suse.cz> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 > >