title: dynamic_cast failed when hiding symbol
body: <p>I have many static libraries. One is static_lib_a.a. I create a dynamic library, dynamic_lib.so to put them together.</p>
  
  <p>In static_lib_a.a, it uses xerces 3.1.1 to parse xml. The following is the code snippet in <strong>static_lib_a.a</strong></p>
  
  <pre><code>xerces::DOMElement *pElementNode = dynamic_cast&lt;xerces::DOMElement *&gt;(pNode);
  </code></pre>
  
  <p>The type of pNode is xerces::DOMNode. It is assigned to an object of xerces::DOMElement. This line of code will do downcasting. </p>
  
  <p>In order to hide all symbols of static_lib_a.a in dynamic_lib.so, I use <strong>-fvisibility=hidden</strong> to build this static library. I found if I add -<strong>fvisibility=hidden</strong>, pElementNode will return a NULL pointer in runtime.  </p>
  
  <p>Version of gcc compiler is 3.4.4.</p>
  
  <p>Does anyone have similar issues before?</p>