News MIPS option -mno-shared

Thiemo Seufer ica2_ts@csv.ica.uni-stuttgart.de
Thu Dec 9 16:53:00 GMT 2004


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)
> 
> The idea is that you can use -KPIC -mno-shared and get code which
> still uses the usual Unix calling convention, but is slightly more
> efficient at each function entry.  Of course, the resulting code is
> not position independent and can not be put into a shared library.
> Hence the name -mno-shared.

It will also break 64bit addressing. IMHO it should check for that,
and either fail or fall back to the old code sequence.


Thiemo



More information about the Binutils mailing list