[PATCH] Fix 64-bit T3 invert_limb.asm on PIC again.

Torbjorn Granlund tg at gmplib.org
Mon Apr 15 22:34:24 CEST 2013


David Miller <davem at davemloft.net> writes:

  Some of this stuff doesn't work, for example, from invert_limb.asm:
  
  +       rd      %pc, %g3
  +       sethi   %hi(_GLOBAL_OFFSET_TABLE_+4), %g4
  +       add     %g4, %lo(_GLOBAL_OFFSET_TABLE_+8), %g4
  +       add     %g3, %g4, %g4
          sethi   %hi(approx_tab-512), %g2
          or      %g2, %lo(approx_tab-512), %g2
  +       ldx     [%g4+%g2], %g2
  
  You can't use "approx_tab-512", you're addressing the GOT slot
  of the resolved address, not the address itself.
  
  That's why my fix used:
  
  	sethi   %hi(approx_tab), %g2
  	or      %g2, %lo(approx_tab), %g2
  	ldx     [%g4+%g2], %g2
  	sub	%g2, 512, %g2
  
What you say makes a lot of sense.  But I did run complete tests on two
systems...

Couldn't there be a got slot made for for approx_tab-512?

Else, I cannot understand how this could have worked!

-- 
Torbjörn


More information about the gmp-devel mailing list