From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24910 invoked by alias); 11 May 2010 17:35:04 -0000 Received: (qmail 24887 invoked by uid 48); 11 May 2010 17:35:01 -0000 Date: Tue, 11 May 2010 17:35:00 -0000 From: "jan dot kratochvil at redhat dot com" To: gdb-prs@sourceware.org Message-ID: <20100511173459.11586.jan.kratochvil@redhat.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug backtrace/11586] New: RFE: .eh_frame_hdr support (=speed-up) X-Bugzilla-Reason: CC Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2010-q2/txt/msg00240.txt.bz2 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.