From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 584423846414 for ; Mon, 19 Dec 2022 15:09:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 584423846414 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from tarox.wildebeest.org (83-87-18-245.cable.dynamic.v4.ziggo.nl [83.87.18.245]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 222B630067C3; Mon, 19 Dec 2022 16:09:31 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id B3EFA413CD0E; Mon, 19 Dec 2022 16:09:30 +0100 (CET) Message-ID: <39e57e080be477edd4f7239d43ff1188bbb4814e.camel@klomp.org> Subject: Re: [PATCHv2] support ZSTD compression algorithm From: Mark Wielaard To: Martin =?UTF-8?Q?Li=C5=A1ka?= , elfutils-devel@sourceware.org Date: Mon, 19 Dec 2022 16:09:30 +0100 In-Reply-To: References: <24d7165b-b8ac-ea5d-a046-aec2203696a9@suse.cz> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.28.5 (3.28.5-10.el7) Mime-Version: 1.0 X-Spam-Status: No, score=-3031.1 required=5.0 tests=BAYES_00,BODY_8BITS,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Martin, On Mon, 2022-12-19 at 15:19 +0100, Martin Li=C5=A1ka wrote: > On 12/15/22 14:17, Mark Wielaard wrote: > > Is there a particular way you are running eu-readelf? Is it with > > generic -w or -a, or decoding a specific section type? >=20 > Hello. >=20 > $ LD_LIBRARY_PATH=3D./libelf ./src/readelf -w > ~/Programming/testcases/a.out >=20 > where I get: >=20 > ./src/readelf: cannot get debug context descriptor: No DWARF > information found >=20 > DWARF section [37] '.debug_info' at offset 0x1ab2: > [Offset] > ./src/readelf: cannot get next unit: no error >=20 > Call frame information section [13] '.eh_frame' at offset 0x4a8: > ... > =20 > =20 > t=EF=BF=BD=EF=BF=BDo5=EF=BF=BD=EF=BF=BD=3DI=EF=BF=BDiAp@a=EF=BF=BD= =EF=BF=BD=EF=BF=BD=EF=BF=BDS^R/<=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF= =BD^=EF=BF=BDqi=EF=BF=BD=D6=B7p@ [...] > So basically a garbage. And I don't know how to bail out properly? Aha. If you have that a.out somewhere I can take a look. I suspect this is because we expect all .debug sections to have been decompressed in libdw/dwarf_begin_elf.c, but that isn't really true, see check_section in that file which has: if ((shdr->sh_flags & SHF_COMPRESSED) !=3D 0) { if (elf_compress (scn, 0, 0) < 0) { /* It would be nice if we could fail with a specific error. But we don't know if this was an essential section or not. So just continue for now. See also valid_p(). */ return result; } } We should probably adjust valid_p so it produces a more appropriate error message and/or add additional checks in readlelf.c. But lets do that after this patch goes in. Cheers, Mark