News MIPS option -mno-shared

Richard Sandiford rsandifo@redhat.com
Thu Dec 9 16:41:00 GMT 2004


Ian Lance Taylor <ian@wasabisystems.com> writes:
> 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.

Yeah, this has been on my to-do list for a while ;)  Are you going to
do the same thing for n32 or are you only interested in o32?

FWIW, the patch looks good to me if it's o32 only.

Richard



More information about the Binutils mailing list