title: How can dylib unload itself?
body: <p>I am trying to understand few things about using dylib and still studying, so please excuse me if I ask stupid question.</p>
  
  <ol>
  <li>Is it possible for lib loaded via dlopen() to unload itself? </li>
  </ol>
  
  <p>Ex. In code below, can we just execute the hello() code then at the end unload it.</p>
  
  <pre><code> __attribute__((constructor))
   static void hello()
  {
     // get handle to this dylib some how ???
     // some how unload itself ????
  }
  </code></pre>
  
  <p>I have seen on few links, that it is possible to unload a libray from itself. But it is for windows. <a href="http://www.blizzhackers.cc/viewtopic.php?p=2483118" rel="nofollow">Lib unload itself</a>.</p>
  
  <p>2 . Can another process unload the library injected in some xyz process?</p>