From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0152939A607F; Wed, 5 May 2021 14:36:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0152939A607F From: "mark at klomp dot org" To: elfutils-devel@sourceware.org Subject: [Bug libdw/27805] libdwfl: Unable to extract source line information for RISC-V binary Date: Wed, 05 May 2021 14:36:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: elfutils X-Bugzilla-Component: libdw X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mark at klomp dot org X-Bugzilla-Status: UNCONFIRMED 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: 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: Wed, 05 May 2021 14:36:30 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27805 Mark Wielaard changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mark at klomp dot org --- Comment #2 from Mark Wielaard --- (In reply to Jim Wilson from comment #1) > Using readelf -wr to look at the debug_aranges section, I see entries like >=20 > Length: 44 > Version: 2 > Offset into .debug_info: 0x987 > Pointer Size: 4 > Segment Size: 0 >=20 > Address Length > 00000000 00000000 > 20400132 00000002 > 20400134 0000003a > 00000000 00000000 >=20 > An address/length entry of 0/0 is supposed to mark the end of the list, b= ut > here we have one at the beginning. This is confusing elfutils which is > trying to move byte by byte through the aranges section. > libdw/dwarf_aranges.c has > /* Two zero values mark the end. */ > if (range_address =3D=3D 0 && range_length =3D=3D 0) > break; > and then assumes that the next entry is immediately following, which it > isn't, and it ends up reading garbage. binutils seems to be using the > length field to find the last entry. And readelf is ignoring the 0/0 end= of > list rule so that we can see the invalid entries. >=20 > There are a lot of aranges that have 0/0 entries not at the end of the li= st. Any idea where they come from? And what does it look like when using -gdwarf-5? You should get a .debug_rnglists section in that case which has explicit en= d of list markers (before DWARF5 the double zero addresses are interpreted as en= d of list). --=20 You are receiving this mail because: You are on the CC list for the bug.=