FAT GMP 5 binaries

Niels Möller nisse@lysator.liu.se
15 May 2003 12:33:15 +0200

Torbjorn Granlund <tege@swox.com> writes:

> For example, the function mpn_addmul_1 would tailcall
> *(__gmp_cpuvec[RNUM_GMP_ADDMUL_1]).  If that has not previously
> been called, we now hit a setup routine, which checks what CPU
> we're running on and writes the appropriate address to
> __gmp_cpuvec[RNUM_GMP_ADDMUL_1].  (No worries about reentrancy,
> we should write pointers atomically.)

I think it would be clearer to setup the entire table at load time
(i.e. before the startup code calls main()), using the same hooks as
for C++ constructors. That should be fairly simple and portable.

Perhaps one could, in the dynamic library case, even reuse the jump
tables that are setup by ld.so. (I have to reread linkers & loaders to
figure out if that's realistic). But then it gets a lot hairier again.