GMP work on symbol visibility

Niels Möller nisse at lysator.liu.se
Sat Sep 3 08:14:46 UTC 2016


nisse at lysator.liu.se (Niels Möller) writes:

> Is this 6 year old post still valid? 

Hmm, here's a related gcc bug with is marked as fixed,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51880, also marked as a dup
of the old bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19520 Ian
refers to.

> I guess it would also be useful with some function __attribute__
> expressing that "I don't give a damn whether or not pointer comparison
> for address(es) to this function work according to the C standard".

Anyone else who thinks that would be a good idea? I'm considering filing
a bug report/feature request to gcc.

Anyway, as to using protected, it seems it's a bit too hairy for its
own good. 

But why doesn't symbol aliases with hidden visibility have the same
issues?

Say we have an internal symbol mpn_foo_internal with visibility
"hidden", and an alias mpn_foo with visibility "default". Then I think
the desirable behaviour is that pointers to mpn_foo and mpn_foo_internal
are equal if and only if the executable doesn't provide a different
implementation of mpn_foo. But I have no idea how that really works. And
since symbol aliases aren't C standard, one could argue that the
standard's rules for pointer equality don't apply.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.


More information about the gmp-devel mailing list