From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22111 invoked by alias); 24 Nov 2014 14:30:38 -0000 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 Received: (qmail 22051 invoked by uid 48); 24 Nov 2014 14:30:33 -0000 From: "uweigand at gcc dot gnu.org" To: systemtap@sourceware.org Subject: [Bug runtime/17638] Symbol resolution broken for PPC64 ABIv2 Date: Mon, 24 Nov 2014 14:30:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: runtime X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: uweigand at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q4/txt/msg00190.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=17638 Ulrich Weigand changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |uweigand at gcc dot gnu.org --- Comment #3 from Ulrich Weigand --- The DWARF address ranges deliberately include the *whole* function, both global and local entry points. GDB relies on that behavior. (For one, if you look up the function belonging to the current PC, you should find the correct one even if you're before the local entry point.) If you want to set probes on a local entry point, you should look up the symbol in the main symbol table (not DWARF), and check the st_other bits; they will indicate whether the function has a local entry point, and what its offset from the global entry point is. Note that GDB does the same when setting a breakpoint on a function entry. You can use the PPC64_LOCAL_ENTRY_OFFSET macro from the binutils header files (elf/ppc64.h) to decode the st_other bits. See also the GDB routines ppc_elfv2_elf_make_msymbol_special and ppc_elfv2_skip_entrypoint (in the GDB patch linked to above). Anton's kernel patch refered to above instead implements code parsing in an attempt to detect the typical global entry point sequence. This should work OK for now, but might cause problems in the future if the sequence generated by GCC (or another compiler) ever changes. Thus, using the ELF symbol st_other bits is certainly the prefered way. -- You are receiving this mail because: You are the assignee for the bug.