This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Linkage order in Linux


You're talking about two C++ shared libraries, right?

Well, C++ programmers are often surprised when they are bitten by
implentation details of their language.  ;-)

My immediate suspicion would be global variable constructor ordering
dependencies.  You can check whether the libraries have global
constructors by
    nm the_lib | grep 'GLOBAL__I[$._]'
assuming the library hasn't been stripped.  (You might also have the
same problem with libraries that your two libraries need, ldd the_lib
to find the needed libs.)

Check also that you aren't using incompatible versions of libstdc++,
ie. one or more of the libraries and main executable use
libstdc++.so.5 and others use libstdc++.so.6.

Next I'd look to see whether there are dynamic symbols that both
libraries define.  If so, you may find that functions or variables in
one library are being overridden by ones in the other library and all
sorts of things can go wrong.

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]