STV_PROTECTED
Hi,
The elf manpage [2] claims that:
Quoted 1 line
STV_PROTECTEDNot preemptible, not exported.
However the System V gABI [1] claims that:
Quoted 2 lines
A symbol defined in the current component is protected if it is visible in other components but not preemptable
Should the manpage read something like:
Quoted 1 line
STV_PROTECTEDNot preemptible but exported.
[1] http://www.sco.com/developers/gabi/2003-12-17/ch4.symtab.html
[2] http://man7.org/linux/man-pages/man5/elf.5.html
--
Gabriel Corona
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
[CC += Mike]
Hello Gabriel,
Quoted 11 lines · Gabriel Corona
Hi,
The elf manpage [2] claims that:
Quoted 1 line
STV_PROTECTEDNot preemptible, not exported.However the System V gABI [1] claims that:
Quoted 2 lines
A symbol defined in the current component is protected if it is visible in other components but not preemptable
Quoted 7 lines
Should the manpage read something like:
Quoted 1 line
STV_PROTECTEDNot preemptible but exported.[1] http://www.sco.com/developers/gabi/2003-12-17/ch4.symtab.html
I think you are right, but let's see if Mike might confirm, since he originally added that text. (Mike, I suspect there was a wordo here.)
Cheers,
Michael
Signature · 7 lines
Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 14 lines · Michael Kerrisk (man-pages)
Quoted 13 lines · Gabriel Corona
The elf manpage [2] claims that:
Quoted 1 line
STV_PROTECTEDNot preemptible, not exported.However the System V gABI [1] claims that:
Quoted 2 lines
A symbol defined in the current component is protected if it is visible in other components but not preemptable
Should the manpage read something like:
Quoted 1 line
STV_PROTECTEDNot preemptible but exported.
Quoted 7 lines
Quoted 3 lines
[1] http://www.sco.com/developers/gabi/2003-12-17/ch4.symtab.html
I think you are right, but let's see if Mike might confirm, since he originally added that text. (Mike, I suspect there was a wordo here.)
i didn't really author that content, but take it from elf.h in glibc:
#define STV_PROTECTED 3 /* Not preemptible, not exported */
and binutils says:
#define STV_PROTECTED 3 /* Treat as STB_LOCAL inside current component */
and llvm says:
STV_PROTECTED = 3 // Visible in other components but not preemptable
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.
so while "Not preemptible but exported" is more correct, i'm not sure it's still all that great. maybe "Exported; not preemptible in current module." ? -mike
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi Mike,
Quoted 60 lines · Mike Frysinger
Quoted 14 lines · Michael Kerrisk (man-pages)
Quoted 13 lines · Gabriel Corona
The elf manpage [2] claims that:
Quoted 1 line
STV_PROTECTEDNot preemptible, not exported.However the System V gABI [1] claims that:
Quoted 2 lines
A symbol defined in the current component is protected if it is visible in other components but not preemptable
Should the manpage read something like:
Quoted 1 line
STV_PROTECTEDNot preemptible but exported.Quoted 7 lines
Quoted 3 lines
[1] http://www.sco.com/developers/gabi/2003-12-17/ch4.symtab.html
I think you are right, but let's see if Mike might confirm, since he originally added that text. (Mike, I suspect there was a wordo here.)
i didn't really author that content, but take it from
elf.hin glibc:
#defineSTV_PROTECTED3 /* Not preemptible, not exported */and binutils says:
#defineSTV_PROTECTED3 /* Treat asSTB_LOCALinside current component */and llvm says:
STV_PROTECTED= 3 // Visible in other components but not preemptablegabi 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 withSTB_LOCALbinding may not haveSTV_PROTECTEDvisibility. If a symbol definition withSTV_PROTECTEDvisibility from a shared object is taken as resolving a reference from an executable or another shared object, theSHN_UNDEFsymbol table entry created hasSTV_DEFAULTvisibility.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 withSTB_LOCALbinding will not haveSTV_PROTECTEDvisibility.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.
Quoted 2 lines
so while "Not preemptible but exported" is more correct, i'm not sure it's still all that great. maybe "Exported; not preemptible in current module." ?
Thanks for the detailed confirmation, Mike. I made the text:
STV_PROTECTED Symbol is available in other modules,
but references in the local module always resolve to the local symbol.
Thanks for the report Gabriel!
Cheers,
Michael
Signature · 7 lines
Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/ -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html