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

--- Comment #1 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
Erm, isn't that the whole point of marking the symbol 'protected'?

>From the ELF spec:

<quote>
STV_PROTECTED
    A symbol defined in the current component is protected if it is visible in
other components but not preemptable, meaning that any reference to such a
symbol from within the defining component must be resolved to the definition in
that component, even if there is a definition in another component that would
preempt by the default rules. A symbol with STB_LOCAL binding may not have
STV_PROTECTED visibility. If a symbol definition with STV_PROTECTED visibility
from a shared object is taken as resolving a reference from an executable or
another shared object, the SHN_UNDEF symbol table entry created has STV_DEFAULT
visibility.
</quote>

If we know it will resolve to the definition inside this DSO, then we don't
need to indirect via the GOT to address it.

Reply via email to