Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <ghost@cs.msu.su>
To: gdb@sources.redhat.com
Subject: Re: A quick question about high/low_pc and linkonce sections
Date: Fri, 01 Jul 2005 10:52:00 -0000	[thread overview]
Message-ID: <da36pt$ec$1@sea.gmane.org> (raw)
In-Reply-To: <6f48278f05070103134baa0b90@mail.gmail.com>

Jie Zhang wrote:

> Hi,
> 
> This is a piece of code from dwarf2read.c, near the end of
> dwarf2_get_pc_bounds ().
> 
>   /* 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;
> 
> 
> Isn't "high == 0" much better than "low == 0"? It's possible that a
> valid DW_AT_low_pc is 0.

For the record, I've run into this problem myself and had to patch it
around. For my target, "lowpc" is always 0.

Also, the same logic is present at the end of the read_partial_die function.

- Volodya


      reply	other threads:[~2005-07-01 10:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-01 10:13 Jie Zhang
2005-07-01 10:52 ` Vladimir Prus [this message]

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='da36pt$ec$1@sea.gmane.org' \
    --to=ghost@cs.msu.su \
    --cc=gdb@sources.redhat.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