GMP 6.3.0 x86_64 Darwin: mpn_rsh1add_nc/mpn_rsh1sub_nc jump into the stub table, crashing every FFT multiply and square

Niels Möller nisse at lysator.liu.se
Fri Sep 18 22:14:51 CEST 2026


Andrew Pochinsky <avp at mit.edu> writes:

> Sorry for the confusion - that remark was from the agent when it was
> still hunting the bug. The bug is in the assembly code or is caused by
> misidentifying

I doubt that, from reading the description it seems rather clear that
assembly input is correct and object file looks mostly reasonable. It
seems clear that the MacOS linker that does something funky with the
reloc type X86_64_RELOC_BRANCH, for a symbol that is supposed to be
completely local to a single assembly file.

THe way I read it, a reference to a local symbol is replaced with a
reference to a nearby global symbol and an offset. Then the linker
redirects that global symbol via some jump table, and the reference to
the local symbol and its offset is completely mishandled in the process.

I would suggest first trying to bisect linker versions, and when we know
which versions are affected, we can consider workarounds (is there a
different mac-way to tell the linker more firmly that a symbol is purely
local, e.g), and it would also be prudent to bug report to apple.

Regards,
/Niels

-- 
Niels Möller. PGP key CB4962D070D77D7FCB8BA36271D8F1FF368C6677.
Internet email is subject to wholesale government surveillance.


More information about the gmp-bugs mailing list