This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: News MIPS option -mno-shared


David Daney <ddaney@avtrex.com> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]