-l versus dlopen()

Daniel.Walker@lhsl.com Daniel.Walker@lhsl.com
Sun Sep 9 20:23:00 GMT 2001


In desperate trial and error, I've tried giving dlopen() all combinations
of flags:

RTLD_LAZY
RTLD_LAZY | RTLD_GLOBAL
RTLD_NOW
RTLD_NOW | RTLD_GLOBAL

None of them seen to have any affect on the problem. I really suspect that
the order of global constructors is changing in a way that breaks
dependencies somehow. I've heard this can be a problem in C++. Any
suggestion for controlling this?

Thanks!
Daniel Walker



                                                                                                           
                    Alexandre                                                                              
                    Oliva                To:     Daniel.Walker@lhsl.com                                    
                    <aoliva@redhat       cc:     gcc-help@gcc.gnu.org                                      
                    .com>                Subject:     Re: -l versus dlopen()                               
                                                                                                           
                    09/09/2001                                                                             
                    07:34 PM                                                                               
                                                                                                           
                                                                                                           




On Sep  7, 2001, Daniel.Walker@lhsl.com wrote:

> But if I link dynamically with dlopen()

Which flags do you pass to dlopen()?

> the program crashes while executing a global constructor in
> _do_global_ctors_aux(). Is it possible that the constructors in the
library
> are reorder differently depending on how the library is loaded?

Yes, that's certainly possible.

--
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me






More information about the Gcc-help mailing list