This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug backtrace/11586] New: RFE: .eh_frame_hdr support (=speed-up)


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]