From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22578 invoked by alias); 25 Jan 2012 01:12:55 -0000 Received: (qmail 22566 invoked by uid 22791); 25 Jan 2012 01:12:54 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from caibbdcaaaaf.dreamhost.com (HELO homiemail-a93.g.dreamhost.com) (208.113.200.5) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 25 Jan 2012 01:12:41 +0000 Received: from homiemail-a93.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a93.g.dreamhost.com (Postfix) with ESMTP id 1F4EA8405B; Tue, 24 Jan 2012 17:12:41 -0800 (PST) Received: from redwood.eagercon.com (c-76-102-3-160.hsd1.ca.comcast.net [76.102.3.160]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: eager@eagerm.com) by homiemail-a93.g.dreamhost.com (Postfix) with ESMTPSA id C1F3084059; Tue, 24 Jan 2012 17:12:40 -0800 (PST) Message-ID: <4F1F5708.5090500@eagerm.com> Date: Wed, 25 Jan 2012 01:55:00 -0000 From: Michael Eager User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0 MIME-Version: 1.0 To: rsa@us.ibm.com CC: gdb-patches@sourceware.org, Mark Kettenis , "Joseph S. Myers" , Pedro Alves Subject: Re: [PATCH] PowerPC 32 with Secure PLT References: <4F1636C7.4020207@eagercon.com> <4F1F4382.4010103@eagerm.com> <1327451846.3308.300.camel@localhost.localdomain> In-Reply-To: <1327451846.3308.300.camel@localhost.localdomain> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-01/txt/msg00858.txt.bz2 On 01/24/2012 04:37 PM, Ryan Arnold wrote: > On Tue, 2012-01-24 at 15:49 -0800, Michael Eager wrote: >> On 01/17/2012 07:04 PM, Michael Eager wrote: >>> This patch adds support for stepping into/over the PLT stubs generated >>> for secure PLT on PowerPC 32. It requires a recent binutils which >>> generates symbols for the stubs. >>> >>> This has been tested on PowerPC 32-bit systems with and without PAX. >>> >>> 2012-01-17 Michael Eager >>> >>> * configure.tgt (powerpc-*-linux*): Add glibc-tdep.o. >>> * ppc-linux-tdep.c: Include glibc-tdep.h. >>> (powerpc32_plt_stub, powerpc32_plt_stub_so): Add PLT stub templates. >>> (powerpc_linux_in_plt_stub): New function. >>> (powerpc_linux_in_dynsym_resolve_code): New function. >>> (ppc_skip_trampoline_code): New function. >>> (ppc_linux_init_abi): Use PPC specific functions rather than generic. >>> Use glibc_skip_solib_resolver. >> >> Will check in in a couple days, unless I hear additional comments. > > I'm not familiar with the GDB code at all so I couldn't tell from the > patch whether it addresses my concern. > > Prior to resolving the PLT entries will this trap in the loader's > resolver code or does it 'continue' until the PLT entry is populated and > the target symbol address has been branched to? It works in two phases: first steps over the stub to where ever it points (which may be the target function), then it skips over the resolver code if it still hasn't reached the function. > It's fine with me if it skips the PLT stubs and the resolver trampoline > code but being able to step into the resolver code is still useful to me > as a GLIBC developer. Most users don't want to see gdb stepping through symbol resolution on the way to their library function. I didn't run tests with a glibc which had debug symbols, but I think that it will skip over the resolver if you say step. If you want to stop at _dl_resolve, you will need to put a breakpoint at that location. Naturally, if you do stepi, you see each instruction executed. -- Michael Eager eager@eagercon.com 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077