glibc and dopen'ing modules with static TLS problem, question

Andrey Erschov andrey.erschov@gmail.com
Wed Nov 20 03:51:00 GMT 2013


Hello!

On Fedora 19 (64-bit) I'm getting error "cannot load any more object
with static TLS" while running proprietary accounting program, which
tries to load libMagickWand.so, which, in it's order, depends on
libgomp.so compiled with static TLS.

On Ubuntu 13.04 (64-bit) same program works ok.

Running program with LD_PRELOAD=libgomp.so.1 helps, but this is not so
accurate solution, as I think.

Looking into sources of glibc, i've found code responsible for this message:
elf/dl-open.c:541:
  if (! RTLD_SINGLE_THREAD_P && imap->l_tls_modid > DTV_SURPLUS)
    _dl_signal_error (0, "dlopen", NULL, N_("\
cannot load any more object with static TLS"));

So I have a question: shouldn't the right part of && operator be like this:
imap->l_tls_modid >= GL(dl_tls_max_dtv_idx) + DTV_SURPLUS

If no, could you help me with next steps to adress the problem?

Thank you in advance!

--  With best regards,
Andrey



More information about the Libc-help mailing list