From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7B2D83851C3A; Wed, 5 May 2021 15:42:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7B2D83851C3A 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: Wed, 05 May 2021 15:42:45 +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: 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 15:42:45 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27805 --- Comment #3 from Jim Wilson --- My first thought was linkonce/comdat, but that is used by C++ and would have shown up before. So that leaves -gc-sections. I can reproduce with a simp= le example. rohan:2010$ cat tmp.c extern int sub1 (int); extern int sub2 (int); extern int sub3 (int); extern int sub4 (int); int main (void) { return sub2 (sub4 (0)); } rohan:2011$ cat tmp2.c int sub1 (int i) {return i + 10; } int sub2 (int i) {return i + 20; } int sub3 (int i) {return i - 10; } int sub4 (int i) {return i - 20; } rohan:2012$ riscv32-unknown-elf-gcc -O2 tmp.c tmp2.c -ffunction-sections -Wl,-gc-sections -g rohan:2013$ readelf -wr a.out Contents of the .debug_aranges section: Length: 28 Version: 2 Offset into .debug_info: 0x0 Pointer Size: 4 Segment Size: 0 Address Length 00010074 0000000e=20 00000000 00000000=20 Length: 52 Version: 2 Offset into .debug_info: 0x7c Pointer Size: 4 Segment Size: 0 Address Length 00000000 00000000=20 00010114 00000004=20 00000000 00000000=20 00010118 00000004=20 00000000 00000000=20 rohan:2014$=20 I get the same result with an x86_64-linux compiler. And I get the same re= sult with -gdwarf-5. --=20 You are receiving this mail because: You are on the CC list for the bug.=