Illegal subtraction in tmp-dive_1.s

Torbjorn Granlund tg at
Fri Apr 17 09:57:36 CEST 2009

Marc Glisse <marc.glisse at> writes:

  > I don't know if the 64-bit ELF ABI actually allows us to subtract
  > symbols from different sections.  Anybody here knows?
  > If we're in breach of the ABI, or else we want to support a buggy
  > Solaris assembler/linker, we could enable the alternative code in
  > mpn/x86_64/sqr_basecase.asm, see the m4 "ifelse".  The alternative code
  > is probably a bit slower, since it is one instruction longer.  But it
  > might be possible to come up with a better sequence!
  The best discussion on the subject I could find is this thread:
  I believe it means your code is right, although you'll probably
  understand that thread better than I do.

I think my code is "right" too, but then it doesn't work with Solaris
system assembler, I'd still want to fix it.

Unfortunately, I have not been able to find a fast and generally
accepted variant of the jump table.

Perhaps the best way would be to use a section and
use .quad .Lxx for the jump table entries.  This would require some m4
hacking not to make it too system dependent.

Until we can address this, the recommendation is to use the GNU tools
which seem to work well on GNU/Linux, BSD, and Solaris for this code.


More information about the gmp-discuss mailing list