title: GCC: In what way is visibility internal "pretty useless in real world usage"?
body: <p>I am currently developing a library for QNX (x86) using GCC, and I want to make some symbols which are used exclusively in the library and are invisible to other modules, notably to the code which uses the library.</p>
  
  <p>This works already, but, while doing the research how to achieve it, I have found a very worrying passage in GCC's documentation (see <a href="http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/Code-Gen-Options.html#Code-Gen-Options" rel="noreferrer">http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/Code-Gen-Options.html#Code-Gen-Options</a>, explanation for flag -fvisibility):</p>
  
  <blockquote>
    <p>Despite the nomenclature, default always means public; i.e., available
    to be linked against from outside the shared object. protected and
    internal are pretty useless in real-world usage so the only other
    commonly used option is hidden. The default if -fvisibility isn't
    specified is default, i.e., make every symbol public—this causes the
    same behavior as previous versions of GCC.</p>
  </blockquote>
  
  <p>I am very interested in how visibility "internal" is pretty useless in real-world-usage. From what I have understood from another passage from GCC's documentation (<a href="http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/Function-Attributes.html#Function-Attributes" rel="noreferrer">http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/Function-Attributes.html#Function-Attributes</a>, explanation of the visibility attribute), visibility "internal" is even stronger (more useful for me) than visibility "hidden":</p>
  
  <blockquote>
    <p>Internal visibility is like hidden visibility, but with additional
    processor specific semantics. Unless otherwise specified by the psABI,
    GCC defines internal visibility to mean that a function is never
    called from another module. Compare this with hidden functions which,
    while they cannot be referenced directly by other modules, can be
    referenced indirectly via function pointers. By indicating that a
    function cannot be called from outside the module, GCC may for
    instance omit the load of a PIC register since it is known that the
    calling function loaded the correct value.</p>
  </blockquote>
  
  <p>Could anybody explain in depth?</p>