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 4325F3858D32 for ; Thu, 1 Dec 2022 15:54:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4325F3858D32 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 2C209302BBEC; Thu, 1 Dec 2022 16:54:19 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 6B4B94000D0C; Thu, 1 Dec 2022 16:54:19 +0100 (CET) Message-ID: <3a2e39431abb0882b445269420f923e026b6c381.camel@klomp.org> Subject: Re: dwarf_nextcu can't handle abbrev offset correctly ? From: Mark Wielaard To: Hengqi Chen , elfutils-devel@sourceware.org Date: Thu, 01 Dec 2022 16:54:19 +0100 In-Reply-To: References: 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=-3032.8 required=5.0 tests=BAYES_00,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 Hengqi, On Thu, 2022-12-01 at 23:34 +0800, Hengqi Chen via Elfutils-devel wrote: > I am using pahole (which relies on libelf) to process an elf file > ([0]): >=20 > LLVM_OBJCOPY=3D"objcopy" pahole -J --btf_gen_floats --btf_base > vmlinux adl_pci9111.ko >=20 > This failed with: >=20 > die__process: DW_TAG_compile_unit, DW_TAG_type_unit, > DW_TAG_partial_unit or DW_TAG_skeleton_unit expected got member > (0xd)! >=20 > The .ko contains two CU, readelf says that the abbrev offsets are at > 0 and 0x907, > but dwarf_nextcu reports that abbrev offsets are both at 0. >=20 > pahole expects to find DW_TAG_compile_unit, but seams that the wrong > abbrev offset causes the failure. >=20 >=20 > [0]: https://gitlab.com/chenhengqi/loong-debug I took a quick look at the adl_pci9111.ko there. And the issue is that elfutils doesn't know how to handle the relocations for LoongArch yet. Specifically the backend should implement the reloc_simple_type hook. Cheers, Mark