From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7934 invoked by alias); 13 Jun 2012 21:41:26 -0000 Received: (qmail 7926 invoked by uid 22791); 13 Jun 2012 21:41:24 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=AWL,BAYES_00,KHOP_DNSBL_BUMP,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RCVD_IN_MSPIKE_BL,RCVD_IN_MSPIKE_Z,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e31.co.us.ibm.com (HELO e31.co.us.ibm.com) (32.97.110.149) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 13 Jun 2012 21:41:10 +0000 Received: from /spool/local by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 13 Jun 2012 15:41:06 -0600 Received: from d01dlp03.pok.ibm.com (9.56.224.17) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 13 Jun 2012 15:40:22 -0600 Received: from d01relay07.pok.ibm.com (d01relay07.pok.ibm.com [9.56.227.147]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 56093C90063 for ; Wed, 13 Jun 2012 17:40:21 -0400 (EDT) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q5DLeLxN30081254 for ; Wed, 13 Jun 2012 17:40:21 -0400 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 q5DLeKxH029489 for ; Wed, 13 Jun 2012 18:40:20 -0300 Received: from [9.10.86.86] (brimstone.rchland.ibm.com [9.10.86.86]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q5DLeIQM028983; Wed, 13 Jun 2012 18:40:18 -0300 Message-ID: <1339623618.3211.6.camel@brimstone> Subject: Re: [PATCH v2] Powerpc: Use and override SETUP_GOT_ACCESS for ppc476 From: Will Schmidt Reply-To: will_schmidt@vnet.ibm.com To: libc-ports@sourceware.org Cc: willschm@us.ibm.com, ryan.arnold@gmail.com, bergner@vnet.ibm.com Date: Wed, 13 Jun 2012 21:41:00 -0000 In-Reply-To: <1325779034.18291.105.camel@brimstone> References: <1321910448.3416.27.camel@brimstone> <1325779034.18291.105.camel@brimstone> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12061321-7282-0000-0000-000009E2924A X-IsSubscribed: yes Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2012-06/txt/msg00024.txt.bz2 Looks like this one fell off everyones radar. Ryan, can you commit this as-is, or do you want a re-spin to fold in the copyright years, etc? Thanks, -Will On Thu, 2012-01-05 at 09:57 -0600, Will Schmidt wrote: > Hi, > This follows glibc changes (subject:"simplify code for accessing > powerpc GOT", commit 91d2a845) and provides an override for > SETUP_GOT_ACCESS that is suitable for the ppc476 sub-architecture. > > 2012-01-05 Will Schmidt > > * sysdeps/powerpc/powerpc32/476/dl-machine.h: New file. Add a > ppc_got_476 function. > * sysdeps/powerpc/powerpc32/476/sysdep.h: New file. Define the > SETUP_GOT_ACCESS macro for the 476 architecture. > > diff --git a/sysdeps/powerpc/powerpc32/476/dl-machine.h b/sysdeps/powerpc/powerpc32/476/dl-machine.h > new file mode 100644 > index 0000000..826b205 > --- /dev/null > +++ b/sysdeps/powerpc/powerpc32/476/dl-machine.h > @@ -0,0 +1,45 @@ > +/* Machine-dependent ELF dynamic relocation inline functions. PowerPC version. > + Copyright (C) 1995-2002, 2003, 2005, 2006, 2011, 2012 > + Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library; if not, write to the Free > + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA > + 02111-1307 USA. */ > + > +#include > + > +#ifndef PPC_GOT_476_OVERRIDE > +#define PPC_GOT_476_OVERRIDE > + > +/* Return the value of the GOT pointer. */ > +static inline Elf32_Addr * __attribute__ ((const)) > +ppc_got_476 (void) > +{ > + Elf32_Addr *got; > + > + asm (" bl $+8 \n" > + "1: \n" > + " b $+8 \n" > + " blr \n" > + " mflr %0 \n" > + " addis %0,%0,_GLOBAL_OFFSET_TABLE_-1b@ha\n" > + " addi %0,%0,_GLOBAL_OFFSET_TABLE_-1b@l\n" > + : "=b" (got) : : "lr"); > + > + return got; > +} > +#define ppc_got() ppc_got_476() > + > +#endif /* PPC_GOT_476_OVERRIDE */ > diff --git a/sysdeps/powerpc/powerpc32/476/sysdep.h b/sysdeps/powerpc/powerpc32/476/sysdep.h > new file mode 100644 > index 0000000..6f9f2e0 > --- /dev/null > +++ b/sysdeps/powerpc/powerpc32/476/sysdep.h > @@ -0,0 +1,45 @@ > +/* Assembly macros for 32-bit PowerPC. > + Copyright (C) 1999, 2001, 2002, 2003, 2006, 2011, 2012 > + Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library; if not, write to the Free > + Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA > + 02110-1301 USA. */ > + > +#include > +#include > + > +#ifdef __ASSEMBLER__ > + > +#ifdef __ELF__ > + > +/* helper macro for accessing the 32-bit powerpc GOT. */ > +#ifndef ACCESS_GOT_476 > +#define ACCESS_GOT_476 > + > +#undef SETUP_GOT_ACCESS > + > +#define SETUP_GOT_ACCESS(regname,GOT_LABEL) \ > + bl $+8 ; \ > +GOT_LABEL: ; \ > + b $+8 ; \ > + blr ; \ > + mflr (regname) > + > +#endif /* ACCESS_GOT_476 */ > + > +#endif /* __ELF__ */ > + > +#endif /* __ASSEMBLER__ */ > >