From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18764 invoked by alias); 21 May 2009 18:44:11 -0000 Received: (qmail 18755 invoked by uid 22791); 21 May 2009 18:44:10 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 21 May 2009 18:44:05 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n4LIi3Ir017325 for ; Thu, 21 May 2009 14:44:03 -0400 Received: from gateway.sf.frob.com (vpn-14-22.rdu.redhat.com [10.11.14.22]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n4LIi11f013151; Thu, 21 May 2009 14:44:01 -0400 Received: from magilla.sf.frob.com (magilla.sf.frob.com [198.49.250.228]) by gateway.sf.frob.com (Postfix) with ESMTP id 4FA84357B; Thu, 21 May 2009 11:44:00 -0700 (PDT) Received: by magilla.sf.frob.com (Postfix, from userid 5281) id 1A58EFC38D; Thu, 21 May 2009 11:44:00 -0700 (PDT) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Roland McGrath To: Mark Wielaard Cc: systemtap@sourceware.org Subject: Re: dwarf unwinder (only works on i386/x86_64) - now with eh_frame and debug_frame fallback In-Reply-To: Mark Wielaard's message of Thursday, 21 May 2009 10:03:31 +0200 <1242893011.3655.47.camel@hermans.wildebeest.org> References: <1239977157.2336.33.camel@fedora.wildebeest.org> <1240347505.19523.41.camel@hermans.wildebeest.org> <1242893011.3655.47.camel@hermans.wildebeest.org> Message-Id: <20090521184400.1A58EFC38D@magilla.sf.frob.com> Date: Thu, 21 May 2009 18:44:00 -0000 X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2009-q2/txt/msg00662.txt.bz2 > The "ugly" code in these patches is in adjustStartAddress() in > runtime/unwind.c. This really should go into _stp_module_relocate or > read_pointer. One tricky issue here is that we read the eh_frame section > during translation time and then load it in kernel space at module init > time. eh_frame tables can use pointer encodings that are absolute or > pc_relative (actually data relative), so we need to readjust for the new > load location of the eh_frame. In the long run I think the right thing here will be to convert the data at translation time. That is, make all addresses use a simple "absolute" form (as is usual in .debug_frame), which really means "loadbase-relative" for DSOs--i.e., the same as addresses in the symbol table, etc. Then at run time you just have one uniform way to treat addresses in each module. That keeps things as simple as possible at runtime. > Some optimizations that could be done: > - Use the eh_frame_hdr binary search table > (needs careful auditing of adjustStartAddress -> read_pointer). [...] > - Merge debug_frame and eh_frame at runtime and build our own > binary search hdr. By "runtime" here, you mean "translation time", right? In the unspecified future, elfutils libs will provide easy-to-use code for merging tables, emitting them in whichever format, and generating binary search tables. Probably any such optimization concerns can wait for that. Thanks, Roland