From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21860 invoked by alias); 12 May 2005 06:08:20 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 21813 invoked from network); 12 May 2005 06:08:16 -0000 Received: from unknown (HELO omta02ps.mx.bigpond.com) (144.140.83.154) by sourceware.org with SMTP; 12 May 2005 06:08:16 -0000 Received: from grove.modra.org ([144.136.167.90]) by omta02ps.mx.bigpond.com with ESMTP id <20050512060814.YGMZ7537.omta02ps.mx.bigpond.com@grove.modra.org>; Thu, 12 May 2005 06:08:14 +0000 Received: by bubble.grove.modra.org (Postfix, from userid 500) id CD0A3143005; Thu, 12 May 2005 15:38:14 +0930 (CST) Date: Thu, 12 May 2005 06:13:00 -0000 From: Alan Modra To: Richard Henderson Cc: binutils@sources.redhat.com Subject: Re: powerpc new PLT and GOT Message-ID: <20050512060814.GG29302@bubble.grove.modra.org> Mail-Followup-To: Richard Henderson , binutils@sources.redhat.com References: <20050511141249.GA29302@bubble.grove.modra.org> <20050512053747.GA5254@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050512053747.GA5254@redhat.com> User-Agent: Mutt/1.4i X-SW-Source: 2005-05/txt/msg00413.txt.bz2 On Wed, May 11, 2005 at 10:37:47PM -0700, Richard Henderson wrote: > If the program does in fact use different got registers, then there > will have to be more than one PLTresolve. Not if the plt call stubs are modified to copy their got pointer to, say, r12. Or better, if PLTresolve loads its own got pointer, like this: PLTresolve: addis 11,11,(got-plt)@ha addi 11,11,(got-plt)@l mflr 0 bcl 20,31,1f 1: mflr 12 addis 12,12,(got-1b)@ha addi 12,12,(got-1b)@l # r12 = _GLOBAL_OFFSET_TABLE_ mtlr 0 sub 11,11,12 # r11 = index * 4 add 0,11,11 add 11,0,11 # r11 = index * 12 = reloc offset. lwz 0,4(12) # got[1] address of dl_runtime_resolve mtctr 0 lwz 12,8(12) # got[2] contains the map address bctr > At which point it doesn't > make sense to have DT_PPC_GLINK pick out any one of them. I suggest > simply setting this entry to 1, as with DT_TEXTREL. I agree however that the dynamic linker doesn't need to know where Pltresolve is, so any non-zero value in DT_PPC_GLINK will do. (It did need to know when I was still considering a BSS PLT.) -- Alan Modra IBM OzLabs - Linux Technology Centre