I have an application that use dlopen()
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.
However if they are copied to Ubuntu 12.04 i386 then some (but not all) modules fail to load with the following message:
dlopen: cannot load any more object with static TLS
I would suspect that this is caused by the usage of __thread
variables. However such variables are not used in the loaded modules - only in the loader module itself.
Can someone provide any additional info, what can be the reason?
I am reducing number of __thread
variables and optimizing them (with -ftls-model
etc), I'm just curious why it doesn't work on almost same system.