From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 99D5F3858C2F; Tue, 28 Mar 2023 08:58:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 99D5F3858C2F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679993885; bh=rLSoAp3RYxNdOmBuEDPLk7LxvvTTiMTLZSR0UR6SbwA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UWiZ+0b3Yxd21/XpUEnW0F+ERPv6s/GCMYAi6HhECyTNuGV7zE68dzKbrm82QkpS1 ccP/nexfbGQMj8UvZ2aH4E+hAKVU8CcN/21XePWkJ9MxQ/UsEuKAMUW3xg6OFG8d6a 2VRLHmfbqckqLowV7iw8ygJFY9pJeoteFpzcV8Sc= From: "corinna at vinschen dot de" To: gdb-prs@sourceware.org Subject: [Bug win32/18027] dwarf2 debug info after rebasing DLLs unusable Date: Tue, 28 Mar 2023 08:58:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: win32 X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: corinna at vinschen dot de 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: 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D18027 --- Comment #20 from Corinna Vinschen --- (In reply to Nick Clifton from comment #19) > (In reply to Corinna Vinschen from comment #18) >=20 > > what do you think about Tom's idea in comment 14? >=20 > To be honest, I do not get what Tom is suggesting. :-( What is that > coffread.c should be detecting and then doing ? That's what GDB would be able to do if the extra section with the original address is available. There would be an offset between original address and rebased address which could be taken into account. > > Would it be possible to add something like that? > > Maybe like I suggest in comment 16? >=20 > It certainly should be possible for the linker to add an extra section.=20 > There is already a precedence for this, for example when it creates the > .reloc section. >=20 > In fact it may even be possible to create the section and its contents us= ing > the > default linker script, so that there is no need to change the linker at a= ll. > For example adding (untested): >=20 > .debug_pe_defaddr 0 { .long DLLMain } Aha, nice. That should ideally be the load address of the DLL, so I tried this with the Cygwin DLL which provides its own linker script, and I came up with: .debug_pe_defaddr ALIGN(__section_alignment__) (NOLOAD) : { QUAD (__image_base__) } which appears to work. > Cheers > Nick >=20 > PS. I assume that the rebase program cannot update the addresses in the > debug information itself ? Rebasing is actually not performed by some code we have under control. Rather, we're calling a function Rebase64(), which is part of Windows itsel= f. Given that Windows has no idea what Dwarf-2 is, it doesn't even touch these sections. > PPS. Would the __pei386_runtime_relocator symbol be of any use in address= ing > this problem ? I have no idea. How so? Thanks, Corinna --=20 You are receiving this mail because: You are on the CC list for the bug.=