From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E74ED3893648; Mon, 8 Feb 2021 11:14:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E74ED3893648 From: "mark at klomp dot org" To: elfutils-devel@sourceware.org Subject: [Bug general/27367] readelf: invalid loclists data with -ffat-lto-objects Date: Mon, 08 Feb 2021 11:14:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: elfutils X-Bugzilla-Component: general X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mark at klomp dot org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: everconfirmed cf_reconfirmed_on bug_status cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 11:14:17 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27367 Mark Wielaard changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2021-02-08 Status|UNCONFIRMED |NEW CC| |mark at klomp dot org --- Comment #4 from Mark Wielaard --- Same for git HEAD/0.183 Without -flto and -ffat-lto-objects this looks like: DWARF section [ 7] '.debug_loclists' at offset 0xff: Table at Offset 0x0: Length: 24 DWARF version: 5 Address size: 8 Segment size: 0 Offset entries: 0 CU [ c] base: .text+000000000000000000 Offset: c, Index: 0 view pair 2, 3 Offset: e, Index: 2 start_length 0x0, 0 .text+000000000000000000 .. 0xffffffffffffffff [ 0] lit0 [ 1] stack_value end_of_list Note that it starts with a view pair, and in the non-lto variant eu-readelf does know which CU this is associated with, while in the lto variant it says "Not associated with a CU." The issue seems to be that eu-readelf seeing both .debug_info and .gnu.debuglto_.debug_info (you get both when using -ffat-lto-objects) picks= the .gnu.debuglto_.debug_info and drops/skips the .debug_info. The following "fixes" it: diff --git a/libdw/dwarf_begin_elf.c b/libdw/dwarf_begin_elf.c index 757ac4fa..49ec0f22 100644 --- a/libdw/dwarf_begin_elf.c +++ b/libdw/dwarf_begin_elf.c @@ -137,10 +137,10 @@ check_section (Dwarf *result, size_t shstrndx, Elf_Scn *scn, bool inscngrp) gnu_compressed =3D true; break; } - else if (scnlen > 14 /* .gnu.debuglto_ prefix. */ - && strncmp (scnname, ".gnu.debuglto_", 14) =3D=3D 0 - && strcmp (&scnname[14], dwarf_scnnames[cnt]) =3D=3D 0) - break; +// else if (scnlen > 14 /* .gnu.debuglto_ prefix. */ +// && strncmp (scnname, ".gnu.debuglto_", 14) =3D=3D 0 +// && strcmp (&scnname[14], dwarf_scnnames[cnt]) =3D=3D 0) +// break; } if (cnt >=3D ndwarf_scnnames) But of course that breaks showing .gnu.debuglto_ sections... --=20 You are receiving this mail because: You are on the CC list for the bug.=