title: Cannot load any more object with static TLS
body: <p>I have an application that use <code>dlopen()</code> to load additional modules. The application and modules are built on Ubuntu 12.04 x86_64 using gcc 4.6 but for i386 arch. The binaries are then copied to another machine with exactly same OS and work fine.</p>
  
  <p>However if they are copied to Ubuntu 12.04 i386 then some (but not all) modules fail to load with the following message:</p>
  
  <pre><code>dlopen: cannot load any more object with static TLS
  </code></pre>
  
  <p>I would suspect that this is caused by the usage of <code>__thread</code> variables. However such variables are not used in the loaded modules - only in the loader module itself.</p>
  
  <p>Can someone provide any additional info, what can be the reason?</p>
  
  <p>I am reducing number of <code>__thread</code> variables and optimizing them (with <code>-ftls-model</code> etc), I'm just curious why it doesn't work on <em>almost</em> same system.</p>