public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "corinna at vinschen dot de" <sourceware-bugzilla@sourceware.org>
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	[thread overview]
Message-ID: <bug-18027-4717-W1RdEm34rH@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-18027-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=18027

--- Comment #20 from Corinna Vinschen <corinna at vinschen dot de> ---
(In reply to Nick Clifton from comment #19)
> (In reply to Corinna Vinschen from comment #18)
> 
> > what do you think about Tom's idea in comment 14?
> 
> 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?
> 
> It certainly should be possible for the linker to add an extra section. 
> There is already a precedence for this, for example when it creates the
> .reloc section.
> 
> In fact it may even be possible to create the section and its contents using
> the
> default linker script, so that there is no need to change the linker at all.
> For example adding (untested):
> 
>   .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
> 
> 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 itself.
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 addressing
> this problem ?

I have no idea.  How so?


Thanks,
Corinna

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2023-03-28  8:58 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-26  5:36 [Bug win32/18027] New: " corinna at vinschen dot de
2015-02-26  9:39 ` [Bug win32/18027] " asmwarrior at gmail dot com
2023-02-11 17:48 ` tromey at sourceware dot org
2023-02-12 12:20 ` ssbssa at sourceware dot org
2023-02-13 10:31 ` corinna at vinschen dot de
2023-02-13 10:36 ` corinna at vinschen dot de
2023-02-13 14:01 ` simark at simark dot ca
2023-02-13 16:17 ` corinna at vinschen dot de
2023-02-13 17:13 ` simark at simark dot ca
2023-02-13 17:24 ` ssbssa at sourceware dot org
2023-02-13 19:23 ` tromey at sourceware dot org
2023-02-13 19:46 ` ssbssa at sourceware dot org
2023-02-13 19:48 ` corinna at vinschen dot de
2023-02-13 22:08 ` tromey at sourceware dot org
2023-02-15 10:22 ` corinna at vinschen dot de
2023-02-17  2:15 ` tromey at sourceware dot org
2023-02-28 14:43 ` tromey at sourceware dot org
2023-02-28 15:20 ` corinna at vinschen dot de
2023-02-28 15:22 ` corinna at vinschen dot de
2023-03-24 17:31 ` tromey at sourceware dot org
2023-03-24 19:00 ` corinna at vinschen dot de
2023-03-27  9:19 ` nickc at redhat dot com
2023-03-28  8:58 ` corinna at vinschen dot de [this message]
2023-03-28 14:01 ` nickc at redhat dot com
2023-03-28 18:10 ` corinna at vinschen dot de
2023-03-29 12:46 ` tromey at sourceware dot org
2023-03-30  9:23 ` corinna at vinschen dot de
2023-03-30  9:24 ` corinna at vinschen dot de
2023-04-21 16:38 ` tromey at sourceware dot org
2023-04-21 16:54 ` tromey at sourceware dot org
2023-04-21 17:11 ` tromey at sourceware dot org
2023-04-21 19:48 ` corinna at vinschen dot de
2023-04-24 15:54 ` tromey at sourceware dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-18027-4717-W1RdEm34rH@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).