6

initialization order of libraries

view full story
linux-howto

http://www.linuxforums.org – To My knowledge, the initialization order of shared libraries should be decided by their dependency relationship. for example, a program links to libA, libB and libC. libA uses something in libB, and libB uses something in libC. so the initialization orders would be libC, libB and then libA. in other words. all global objects in libC must be initialized before all global objects in libB. however, one of my applications brokes the above rule. Global objects in libA constructs first. I am wondering if there is the so called cyclic dependency problems on linux platform. on solaris platform, sometimes, you got cyclic dependency which causes initializtion order problems. if the anwer is yes, is there a way to find what causes the cyclic dependency? I used ldd -d, but it seems it can't search libs in correct path. thanks in advance. (HowTos)