Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Frederic RISS <frederic.riss@st.com>
To: Jim Blandy <jimb@codesourcery.com>
Cc: Steven Johnson <sjohnson@sakuraindustries.com>, gdb@sources.redhat.com
Subject: Re: Problems with startup code symbols (Copious warnings)
Date: Mon, 19 Jun 2006 09:36:00 -0000	[thread overview]
Message-ID: <1150704956.2480.65.camel@crx549.cro.st.com> (raw)
In-Reply-To: <vt2mzcfxonz.fsf@theseus.home.>

On Wed, 2006-06-14 at 17:12 -0700, Jim Blandy wrote:
[...]
>   /* When using the GNU linker, .gnu.linkonce. sections are used to
>      eliminate duplicate copies of functions and vtables and such.
>      The linker will arbitrarily choose one and discard the others.
>      The AT_*_pc values for such functions refer to local labels in
>      these sections.  If the section from that file was discarded, the
>      labels are not in the output, so the relocs get a value of 0.
>      If this is a discarded function, mark the pc bounds as invalid,
>      so that GDB will ignore it.  */
>   if (low == 0 && (bfd_get_file_flags (obfd) & HAS_RELOC) == 0)
>     return 0;
> 
> (Linkonce sections are a crock: if a section of code is discarded, the
> debug info should be discarded along with it, but there's no way to do
> that with linkonce sections.)  But in your case, you really have a
> compilation unit at address zero.
[...]
> If anyone can see a way to handle discarded linkonce sections better,
> I'd love to hear it.

What about looking at section VMAs? If one loadable section has a VMA of
0 then we can't discard debug info with low_pc == 0. If no section lives
at address 0 then low_pc == 0  implies that the relocations for this
info couldn't be applied because the code has vanished.
I'm sure I missed somethnig in the general case, but I've added
something like this as a post-load pass in a target_so_ops I implemented
some time ago and it worked well.

Fred.


  reply	other threads:[~2006-06-19  8:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-08  7:23 Steven Johnson
2006-06-08  9:06 ` Jim Blandy
2006-06-08 12:25   ` Steven Johnson
2006-06-08 23:10     ` Steven Johnson
2006-06-15  0:12     ` Jim Blandy
2006-06-15  7:33       ` Jim Blandy
2006-06-19  9:36         ` Frederic RISS [this message]
2006-06-20 12:23           ` Daniel Jacobowitz
2006-06-20 12:33             ` Frederic RISS
2006-06-20 12:56               ` Daniel Jacobowitz
2006-06-20 13:09                 ` Frederic RISS
2006-06-20 20:17                   ` Steven Johnson
2006-06-20 23:35                     ` Daniel Jacobowitz
2006-06-21  8:54                       ` Frederic RISS
2006-06-21 14:44                         ` Steven Johnson
2006-06-21 15:28                         ` Daniel Jacobowitz
2006-06-19 10:00         ` Steven Johnson

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=1150704956.2480.65.camel@crx549.cro.st.com \
    --to=frederic.riss@st.com \
    --cc=gdb@sources.redhat.com \
    --cc=jimb@codesourcery.com \
    --cc=sjohnson@sakuraindustries.com \
    /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