public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
To: "Michael Kerrisk (man-pages)"
	<mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Gabriel Corona
	<gabriel.corona-Pj3lBMu8rt9bbU8NOSLlsg@public.gmane.org>,
	linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: STV_PROTECTED
Date: Wed, 9 Mar 2016 00:01:36 -0500	[thread overview]
Message-ID: <20160309050136.GR6588@vapier.lan> (raw)
In-Reply-To: <56DF7669.70204-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 3051 bytes --]

On 09 Mar 2016 02:03, Michael Kerrisk (man-pages) wrote:
> On 09/29/2015 12:14 PM, Gabriel Corona wrote:
> > The elf manpage [2] claims that:
> > 
> >> STV_PROTECTED   Not preemptible, not exported.
> > 
> > However the System V gABI [1] claims that:
> > 
> >> 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:
> > 
> >> STV_PROTECTED   Not 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
> 
> 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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2016-03-09  5:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-29 10:14 STV_PROTECTED Gabriel Corona
     [not found] ` <20150929101411.GA17105-0+RUnzqQamR98t58zOhiHA@public.gmane.org>
2016-03-09  1:03   ` STV_PROTECTED Michael Kerrisk (man-pages)
     [not found]     ` <56DF7669.70204-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-03-09  5:01       ` Mike Frysinger [this message]
     [not found]         ` <20160309050136.GR6588-UgUKS2FnFs9+urZeOPWqwQ@public.gmane.org>
2016-03-09 18:26           ` STV_PROTECTED Michael Kerrisk (man-pages)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160309050136.GR6588@vapier.lan \
    --to=vapier-abrp7r+bbdudnm+yrofe0a@public.gmane.org \
    --cc=gabriel.corona-Pj3lBMu8rt9bbU8NOSLlsg@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox