From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D35203891C2B; Sat, 1 May 2021 20:48:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D35203891C2B From: "wilson at gcc dot gnu.org" To: elfutils-devel@sourceware.org Subject: [Bug libdw/27805] libdwfl: Unable to extract source line information for RISC-V binary Date: Sat, 01 May 2021 20:48:57 +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: wilson at gcc dot gnu.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: Sat, 01 May 2021 20:48:57 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27805 Jim Wilson changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wilson at gcc dot gnu.org --- Comment #1 from Jim Wilson --- Using readelf -wr to look at the debug_aranges section, I see entries like Length: 44 Version: 2 Offset into .debug_info: 0x987 Pointer Size: 4 Segment Size: 0 Address Length 00000000 00000000 20400132 00000002 20400134 0000003a 00000000 00000000 An address/length entry of 0/0 is supposed to mark the end of the list, but here we have one at the beginning. This is confusing elfutils which is try= ing 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 fiel= d to find the last entry. And readelf is ignoring the 0/0 end of list rule so t= hat we can see the invalid entries. There are a lot of aranges that have 0/0 entries not at the end of the list. --=20 You are receiving this mail because: You are on the CC list for the bug.=