nisse at lysator.liu.se
Mon Jan 14 22:22:28 CET 2013
David Miller <davem at davemloft.net> writes:
> IFUNC relocations allow symbols to resolve based upon run-time checks,
> such as tests on the cpu type.
I think that's nice. There are a couple of difficulties, though.
GMP also wants to set up machine-dependent threshold variables, i.e.,
data rather than code. And it wants to set it all up at the same time
(since calling some machine-specific functions may break if we're using
default thresholds), which I guess is a bit unusual. Can you do that
Furthermore, gmp needs to be portable to non-glibc systems as well. We
have a "fat binary" machinery that tries to solve the same problem, but
in a more portable way. Choosing between using IFUNC or the portable
machinery at configure time sounds like it could be a lots of additional
It might be easier to put some initialization code to be called before
main (like for constructors and the like). That's also not as portable
as the current machinery, I'm afraid, but I guess it should be doable in
some way or the other with all linkers which support basic C++ features.
Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.
More information about the gmp-devel