From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 92C6E3854814; Tue, 24 Nov 2020 01:07:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 92C6E3854814 From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug mi/26935] New: [gdb/testsuite] Using gold in gdb.base/morestack.exp causes incorrect debug info Date: Tue, 24 Nov 2020 01:07:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: mi X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2020 01:07:20 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26935 Bug ID: 26935 Summary: [gdb/testsuite] Using gold in gdb.base/morestack.exp causes incorrect debug info Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: mi Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- Consider test-case morestack.exp, compiled with target board unix/-m32/-fPIE/-pie. When running the test-case, it passes, but there are warnings, as mentioned= in PR26933. The executable debug info contains the following info: ... CU: ../../../../libgcc/config/i386/morestack.S: File name Line number Starting address View Stmt morestack.S 109 0xd0c x morestack.S 113 0xd0d x ... morestack.S 830 0xe66 x morestack.S 831 0xe6a x morestack.S 832 0xe6e x morestack.S 838 0xe73 x morestack.S - 0xe74 x morestack.S 636 0 x morestack.S 637 0x3 x morestack.S - 0x4 x ... Note that at 0xdc, we find: ... 00000d0c <__morestack_non_split>: d0c: 50 push %eax ... but at address 0, there's no text section. Looking at morestack.o, we see two relocations for .debug_line: ... Relocation section '.rel.debug_line' at offset 0x8f4 contains 2 entries: Offset Info Type Sym. Value Symbol's Name 0000004e 00000101 R_386_32 00000000 .text 000000de 00000501 R_386_32 00000000=20=20 .text.__x86.get_pc_thunk.bx ... The first one to be applied here: ... Line Number Statements: [0x0000004b] Extended opcode 2: set Address to 0x0 ... referring to: ... Disassembly of section .text: 00000000 <__morestack_non_split>: ... And the second one to be applied here: ... [0x000000db] Extended opcode 2: set Address to 0x0 ... referring to: ... Disassembly of section .text.__x86.get_pc_thunk.bx: 00000000 <__x86.get_pc_thunk.bx>: ... In the executable we have correctly applied the first: ... Line Number Statements: [0x0000013b] Extended opcode 2: set Address to 0xd0c ... but not the second, it's still stuck at address 0: ... [0x000001ca] Extended opcode 2: set Address to 0x0 ... The executable is build with gold. If we use ld.bfd instead (and remove the printf, which requires gold, from the test-case), the test-case also passes= and the warnings are gone. However, the debug info problem described above is still there with ld.bfd. With ld.bfd though, we have correct ranges: ... 00000028 ffffffff 00000000 (base address) 00000028 00000c9c 00000e04 00000028 000009a0 000009a4 00000028 ... while with gold we have the incorrect: ... 00000028 ffffffff 00000000 (base address) 00000028 00000d0c 00000e74 00000028 00000000 00000004 00000028 ... Likewise for .debug_aranges. This is probably the cause for difference in behaviour between using ld.gol= d vs ld.bfd. --=20 You are receiving this mail because: You are on the CC list for the bug.=