public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "jan dot kratochvil at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug backtrace/11586] New: RFE: .eh_frame_hdr support (=speed-up)
Date: Tue, 11 May 2010 17:35:00 -0000	[thread overview]
Message-ID: <20100511173459.11586.jan.kratochvil@redhat.com> (raw)

GDB currently reads only .eh_frame.  Its full read-in is sufficient.
But there is also .eh_frame_hdr which is an index for accelerated lookup.

Current FSF GDB HEAD contains a bug in DW_EH_PE_datarel support.
      /* FIXME: kettenis/20030602: This is the DW_EH_PE_datarel base
         that is used for the i386/amd64 target, which currently is
         the only target in GCC that supports/uses the
         DW_EH_PE_datarel encoding.  */
      got = bfd_get_section_by_name (unit->abfd, ".got");
        unit->dbase = got->vma;
    case DW_EH_PE_datarel:
      base = unit->dbase;

But there should be ".got.plt" instead of ".got" on some targets.
This bug will be hit on .eh_frame_hdr according to Roland.


On Sat, 08 May 2010 10:48:42 +0200, Roland McGrath wrote:
> > But DT_PLTGOT is .got.plt vaddr while DW_EH_PE_datarel expects .got vaddr.
>
> On i386 and x86-64 the _GLOBAL_OFFSET_TABLE_ magic symbol is .got.plt,
> not .got (this varies by machine, see elf_backend_want_got_plt).
>
> magilla 8 % eu-readelf -dSs /lib*/libc.so.6  | egrep -i 'got|GLOBAL_OFFSET'
> [31] .got                 PROGBITS     0000003c54178d30 00178d30 000002a8  8
WA     0   0  8
> [32] .got.plt             PROGBITS     0000003c54178fe8 00178fe8 00000048  8
WA     0   0  8
>   PLTGOT            0x0000003c54178fe8
>   294: 0000003c53f39d5a      4 OBJECT  LOCAL  DEFAULT       15 yypgoto
>   295: 0000003c53f39d5e      4 OBJECT  LOCAL  DEFAULT       15 yydefgoto
>  3688: 0000003c54178fe8      0 OBJECT  LOCAL  DEFAULT      ABS
_GLOBAL_OFFSET_TABLE_
> [31] .got                 PROGBITS     00b2ae74 186e74 00016c  4 WA     0   0  4
> [32] .got.plt             PROGBITS     00b2aff4 186ff4 000028  4 WA     0   0  4
>   PLTGOT            0x00b2aff4
>   302: 00ae7bcc      4 OBJECT  LOCAL  DEFAULT       15 yypgoto
>   303: 00ae7bd0      4 OBJECT  LOCAL  DEFAULT       15 yydefgoto
>  4588: 00b2aff4      0 OBJECT  LOCAL  DEFAULT      ABS _GLOBAL_OFFSET_TABLE_
> magilla 9 %
>
> That's what DW_EH_PE_datarel expects.  GCC's unwinder gets this right.
> AFAICT, GCC does not ever actually emit this encoding in its CFI.  It's
> only actually used by ld in .eh_frame_hdr, where its meaning is the address
> of .eh_frame_hdr instead.
>
> > I do not see any .got.plt <-> .got vaddrs relationship.
>
> Aside from being contiguous, there isn't one.


Verified on Fedora 12 i686 + x86_64 in .eh_frame (not .eh_frame_hdr) are used
only these encodings: DW_EH_PE_absptr (0x00) and 0x1b that is:
        DW_EH_PE_signed
        DW_EH_PE_sdata4
        DW_EH_PE_pcrel
        non-DW_EH_PE_indirect

-- 
           Summary: RFE: .eh_frame_hdr support (=speed-up)
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: backtrace
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: jan dot kratochvil at redhat dot com
                CC: gdb-prs at sourceware dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=11586

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


             reply	other threads:[~2010-05-11 17:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-11 17:35 jan dot kratochvil at redhat dot com [this message]
2010-05-18  9:48 ` [Bug backtrace/11586] " mjw at redhat dot com

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=20100511173459.11586.jan.kratochvil@redhat.com \
    --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).