title: Hiding symbol names in library
body: <p>I want to hide symbol names which are not relevant to the end user and make visible only APIs in my shared or static library. I have a simple code like:</p>
  <pre><code>int f_b1(){
  return 21 ;
  }
  
  int f_b3(){
  return f_b1() ;
  }
  </code></pre>
  <p>I applied the all methods stated <a href="http://www.ibm.com/developerworks/aix/library/au-aix-symbol-visibility/index.html?ca=drs-" rel="nofollow noreferrer">here</a> such as using <code>__attribute__ ((visibility (&quot;hidden&quot;)))</code> and <code>static</code> but without success. My operating system is Ubuntu on an x86_64 processor. Do I need to use special options while compiling with gcc? I am listing modules and function of libraries with <code>nm</code> command. In my example above I only want to make the <code>f_b3</code> function visible. When I use <code>attribute hidden</code> macro compiler does not give any error but the function still exists in list outputted by the <code>nm</code> command.</p>