On Thu, Oct 07, 2010 at 04:50:50PM +0200, Joakim Tjernlund wrote:
> Why not offer some of this on PowerPC32? mcmodel=small would probably be 
> enough.

Well as they say, contributions are welcome.  Note, 32-bit mode doesn't need
this when compiling for the main program, since it does addis/addi already (or
moves the addi into the offset of the memory reference instructions) to load up
addresses (in 32-bit mode, the addis/addi will form any address, but in 64-bit
mode, this can't be used, because addresses are loaded above the 32k limit).

For pic code, it does need to use the GOT in traditional fashion.

Note, the 64-bit ABI requires that r2 have the current function's GOT in it
when the function is called, while the 32-bit ABI uses r2 as a small data
pointer (and possibly r13 as a second small data pointer).  So, in 32-bit mode
you have to get the GOT address by doing call to the next instruction to get
the address in the LR.

So, it isn't as simple as moving the the 64-bit stuff in 32-bit, since there
are different assumptions.

-- 
Michael Meissner, IBM
5 Technology Place Drive, M/S 2757, Westford, MA 01886-3141, USA
meiss...@linux.vnet.ibm.com

Reply via email to