]> git.ipfire.org Git - thirdparty/man-pages.git/commit
elf.5: Fix description of STV_PROTECTED
authorMichael Kerrisk <mtk.manpages@gmail.com>
Wed, 9 Mar 2016 18:25:22 +0000 (19:25 +0100)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Wed, 9 Mar 2016 18:42:54 +0000 (19:42 +0100)
commit2c8e09b4ff09235cc7955021358ade17562aac54
tree3ce9299826d9619e8b5506aa055d20dc57067de8
parentdb337e545c1b6c0ddfd975fbc118b22cb470acea
elf.5: Fix description of STV_PROTECTED

Quoting Mike:

gabi says:
https://refspecs.linuxbase.org/elf/gabi4+/ch4.symtab.html
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.

solaris/oracle says:
https://docs.oracle.com/cd/E26502_01/html/E26507/chapter6-79797.html
A symbol that is defined in the current component is protected
if the symbol is visible in other components, but cannot be
preempted. Any reference to such a symbol from within the defining
component must be resolved to the definition in that component.
This resolution must occur, even if a symbol definition exists in
another component that would interpose by the default rules.
A symbol with STB_LOCAL binding will not have STV_PROTECTED
visibility.

but i think this ibm article is probably the most understandable:
https://www.ibm.com/developerworks/aix/library/au-aix-symbol-visibility/
The symbol is visible outside the current executable or shared
object, but it may not be overridden. In other words, if a
protected symbol in a shared library is referenced by an other
code in the shared library, the other code will always reference
the symbol in the shared library, even if the executable defines
a symbol with the same name.

Reported-by: Gabriel Corona <gabriel.corona@enst-bretagne.fr>
Reported-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man5/elf.5