From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115741 invoked by alias); 29 Oct 2018 15:21:41 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 115727 invoked by uid 89); 29 Oct 2018 15:21:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.1 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=a.out, refuses, aout, situations X-Spam-Status: No, score=-26.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mail.kdab.com Received: from mail.kdab.com (HELO mail.kdab.com) (176.9.126.58) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 29 Oct 2018 15:21:37 +0000 Authentication-Results: mail.kdab.com (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=kdab.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kdab.com; h= content-transfer-encoding:mime-version:message-id:date:date :subject:subject:from:from; s=dkim; t=1540826488; x=1541690489; bh=It6B6qCCGgNmdvuo6iMu5fTKqNjAJGNc68hdsE796pw=; b=sclOB47DrgsW 0BSM+AO0dXYeWDNp/fOfk8Cx2N1UHnkQVmANEBhHaKtBkQJ9PGaLYkvJtUFhAFwu n1ajIeDVGsIGQ6oL7d3iiMSzvbgFPbOfm4rbV3Bx/4zn9DqBI71xSdTEv72rPjbn 88DWx9qAF6WKv3n0gI5Vlc67pFREnZA= X-Virus-Scanned: amavisd-new at kdab.com From: Milian Wolff To: elfutils-devel@sourceware.org Cc: mark@klomp.org, Milian Wolff Subject: [PATCH] Also find CFI in sections of type SHT_X86_64_UNWIND Date: Mon, 29 Oct 2018 15:21:00 -0000 Message-Id: <20181029152126.32610-1-milian.wolff@kdab.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2018-q4/txt/msg00089.txt.bz2 On my system with g++ (GCC) 8.2.1 20180831 with GNU gold (GNU Binutils 2.31.1) 1.16, the .eh_frame section does not have type PROGBITS but rather is using X86_64_UNWIND nowadays: ``` $ echo "int main(){ return 0; }" > test.c $ gcc test.c $ readelf --sections a.out | grep .eh_frame [14] .eh_frame X86_64_UNWIND 0000000000000670 00000670 [15] .eh_frame_hdr X86_64_UNWIND 0000000000000724 00000724 ``` Without this patch, libdw refuses to use the available unwind information, leading to broken backtraces while unwinding. With the patch applied, unwinding works once more in such situations. Signed-off-by: Milian Wolff --- libdw/dwarf_getcfi_elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdw/dwarf_getcfi_elf.c b/libdw/dwarf_getcfi_elf.c index 315cc02f..4bcfe5cd 100644 --- a/libdw/dwarf_getcfi_elf.c +++ b/libdw/dwarf_getcfi_elf.c @@ -298,7 +298,7 @@ getcfi_shdr (Elf *elf, const GElf_Ehdr *ehdr) } else if (!strcmp (name, ".eh_frame")) { - if (shdr->sh_type =3D=3D SHT_PROGBITS) + if (shdr->sh_type =3D=3D SHT_PROGBITS || shdr->sh_type =3D=3D SHT_X= 86_64_UNWIND) return getcfi_scn_eh_frame (elf, ehdr, scn, shdr, hdr_scn, hdr_vaddr); else --=20 2.19.1