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

Torbjorn Granlund tg at gmplib.org
Mon Apr 15 22:09:48 CEST 2013

David Miller <davem at davemloft.net> writes:

  I use rd %pc here, since moving forward that's what we're going to
I checked in something similar, and also updated the other sparc64 files
to use rd %pc.

  I tried to look into doing something like:
  L(pc):	rd	%pc, %g2
  	sethi	%hi(approx_tab-L(pc)-512), %g3
  	or	%g3, %lo(approx_tab-L(pc)-512), %g3
  	add	%g2, %g3, %g3
  but we can't do that on 64-bit, we have to handle this properly regardless
  of how the linker orders the .text section relative to the .rodata section,
  which means we need to be able to potentially have a negative offset here.
  Accomodating a negative offset means using sethi+xor with the
  "%hix22()" and "%lox10()" relocs, which gets us potentially right back
  into the area where we could hit Solaris assembler/linker quirks.
This is how it is with PIC code and relocs.  I've been here many times
over the years, with GMP.

  Meanwhile, I'm going to install Solaris10 on my Ultra-III box here
  over the next day or two and work on looking into what's going wrong

That's a good idea.  Or you could accept Niels' offer for a guest

  with the gotdata stuff since I've gotten nothing but silence on the
  test tarball.
It terrible that I don't run every test you ask me to run immediately,
day or night.  :-)

  Torbjon, is the gcc on that Solaris box of your's the one that came as
  part of the Solaris install?

I think so:

swift> which gcc
(I neither installed nor maintain this system.)


More information about the gmp-devel mailing list