From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13012 invoked by alias); 18 Jan 2012 15:33:43 -0000 Received: (qmail 13003 invoked by uid 22791); 18 Jan 2012 15:33:41 -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-a55.g.dreamhost.com) (208.113.200.5) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 Jan 2012 15:33:09 +0000 Received: from homiemail-a55.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a55.g.dreamhost.com (Postfix) with ESMTP id 217C312C0E3; Wed, 18 Jan 2012 07:33:07 -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-a55.g.dreamhost.com (Postfix) with ESMTPSA id 00E0C12C0D4; Wed, 18 Jan 2012 07:33:06 -0800 (PST) Message-ID: <4F16E632.6010102@eagerm.com> Date: Wed, 18 Jan 2012 16:37: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: Joel Brobecker CC: "gdb-patches@sourceware.org" Subject: Re: [PATCH] PowerPC 32 with Secure PLT References: <4F163E35.1080505@eagerm.com> <20120118120831.GB31383@adacore.com> In-Reply-To: <20120118120831.GB31383@adacore.com> 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/msg00670.txt.bz2 On 01/18/2012 04:08 AM, Joel Brobecker wrote: >> 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. > > Overall, this looks good to me, but I am not a Linux specialist, > so please give it another week before checking in to give the other > maintainers a chance to comment as well. > > Below are some comments. > >> +#define POWERPC32_PLT_STUB_LEN \ >> + (sizeof powerpc32_plt_stub / sizeof (powerpc32_plt_stub[0])) > > There is a macro, ARRAY_SIZE, that does this for you. > >> +/* Check if PC is in PLT stub. For non-secure PLT, stub is in .plt > > Trailing space at the end of this line... > >> +/* Follow PLT stub to actual routine. */ >> + >> +static CORE_ADDR >> +ppc_skip_trampoline_code (struct frame_info *frame, CORE_ADDR pc) > > There are several lines in the code and the comments of this funtion > that have trailing spaces. Can you get rid of them? > > Also, several lines are too long. The absolute limit is 80 characters, > but the recommended limit is 70 characters. Can you reformat some of > the lines where it doesn't make the code uglier? > >> + target = (CORE_ADDR) read_memory_unsigned_integer (target, 4, byte_order); > > This is an area where I am not sure, but I think it would be better > to use read_memory_typed_address. I think the address type that you > want is: builtin_type (gdbarch)->builtin_func_ptr. Thanks. I'll fix all of these. -- Michael Eager eager@eagercon.com 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077