From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21931 invoked by alias); 8 Dec 2011 03:44:15 -0000 Received: (qmail 21921 invoked by uid 22791); 8 Dec 2011 03:44:14 -0000 X-SWARE-Spam-Status: No, hits=-3.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e8.ny.us.ibm.com (HELO e8.ny.us.ibm.com) (32.97.182.138) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 08 Dec 2011 03:44:01 +0000 Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 7 Dec 2011 22:44:00 -0500 Received: from d01relay01.pok.ibm.com (9.56.227.233) by e8.ny.us.ibm.com (192.168.1.108) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 7 Dec 2011 22:43:19 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pB83hJNs258832 for ; Wed, 7 Dec 2011 22:43:19 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pB83hIom004892 for ; Thu, 8 Dec 2011 01:43:19 -0200 Received: from [9.65.54.90] (sig-9-65-54-90.mts.ibm.com [9.65.54.90]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id pB83hHnH004840; Thu, 8 Dec 2011 01:43:17 -0200 Subject: Re: Next over function with Secure PLT From: Ryan Arnold Reply-To: rsa@us.ibm.com To: Michael Eager Cc: gdb@sourceware.org, Alan Modra , amodra@gmail.com In-Reply-To: <4EE0088C.4070208@eagerm.com> References: <4EE0088C.4070208@eagerm.com> Content-Type: text/plain; charset="UTF-8" Date: Thu, 08 Dec 2011 03:44:00 -0000 Message-ID: <1323315796.3333.98.camel@localhost.localdomain> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit x-cbid: 11120803-9360-0000-0000-00000154EA5E Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-12/txt/msg00007.txt.bz2 On Wed, 2011-12-07 at 16:45 -0800, Michael Eager wrote: > Hi -- > > When using PowerPC Secure PLT, trying to "next" over a > library function in a shared library does not work correctly. > Instead of skipping over the function, gdb steps through > the PLT entry which shows up as code in > call___do_global_ctors_aux. > > This doesn't happen when "nexting" over a library function > in the executable. Next works the same as with a local function. > > When reading the executable, ppc_elf_get_synthetic_symtab() > calls is_nonpic_glink_stub() to recognizes the PLT stub and > then generates internal symbols for each PLT stub like foo@plt. > It also creates an entry for __glink and __glink_PLTresolve. > > If I modify is_nonpic_glink_stub() to recognize the shared > library PLT stub format, similar internal symbols are created > and gdb seems to work correctly. > > There's a comment before the call: > /* If the stubs are those for -shared/-pie then we might have > multiple stubs for each plt entry. If that is the case then > there is no way to associate stubs with their plt entries short > of figuring out the GOT pointer value used in the stub. */ > if (!is_nonpic_glink_stub (abfd, glink, > glink_vma - GLINK_ENTRY_SIZE - glink->vma)) > > What is this trying to tell me? What are the circumstances where > there would be multiple stubs for each PLT entry? If there are > multiple stubs, then this might create multiple foo@plt symbols > with different values. Would this cause any problems? I'm replying to CC Alan on his new-ish email account. Ryan S. Arnold