https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68178

--- Comment #5 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
This particular case is a very specific situation.

A definition of foo is guaranteed to exist (you've provided one); but it can be
overridden.

The definition (due to the use of hidden) has to exist in this share library.

Given the above, we can never get to the situation where the symbol could
resolve to null, nor could we ever get to the situation where the offset to the
definition can't be calculated when linking the shared library.  That makes it
perfectly reasonable to use a pc-relative relocation from within the literal
pool to hold the offset.

It's quite possible that with a subtle change to the conditions you could end
up requiring the compiler to generate another code sequence, but not in this
case.

Reply via email to