From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23246 invoked by alias); 9 Dec 2004 21:20:44 -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 23220 invoked from network); 9 Dec 2004 21:20:40 -0000 Received: from unknown (209.128.65.135) by sourceware.org with QMTP; 9 Dec 2004 21:20:40 -0000 Received: (qmail 16614 invoked by uid 10); 9 Dec 2004 21:20:40 -0000 Received: (qmail 12771 invoked by uid 500); 9 Dec 2004 21:20:31 -0000 From: Ian Lance Taylor To: David Daney Cc: binutils@sourceware.org Subject: Re: News MIPS option -mno-shared References: <20041209153403.5294.qmail@gossamer.airs.com> <41B89F28.9030407@avtrex.com> Date: Thu, 09 Dec 2004 21:20:00 -0000 In-Reply-To: <41B89F28.9030407@avtrex.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-12/txt/msg00109.txt.bz2 David Daney writes: > Ian Lance Taylor wrote: > > I'd like to see whether anybody has an opinion about this patch before > > I check it in. > > > > This patch adds a new option to the MIPS assembler: -mno-shared. > > Normally the .cpload pseudo-op generates code which looks like this: > > > > lui $gp,%hi(_gp_disp) > > addiu $gp,$gp,%lo(_gp_disp) > > addu $gp,$gp,.cpload argument > > > > With -mno-shared, the .cpload pseudo-op will generate code that looks > > like this: > > > > lui $gp,%hi(_gp) > > addiu $gp,$gp,%lo(_gp) > > > > Will this work when ld generates multiple GOTs? Hmmm, I don't know enough about how the MIPS linker handles multiple GOTs to know for sure. My reading of the code indicates to me that it will. It seems that relocations against _gp_disp always use a single value for the output BFD, in which case the above code sequence will work too. Can somebody tell me whether this is not the case, and, if so, how to determine the correct GP value to use when calculating _gp_disp? Ian