Lets say I have a massive project which consists of multiple dynamic libraries that will all get installed to /usr/lib or /usr/lib64. Now lets say that one of the libraries call into another of the compiled libraries. If I place both of the libraries that are dependent on eachother in the same location will the ld program be able to allow the two libraries to call eachother?
The answer is perhaps yes, but it is a very bad design to have circular references between two libraries (i.e. liba.so
containing function fa
, calling function fb
from libb.so
, calling function ga
from liba.so
).
You should merge the two libraries in one libbig.so
. And don't worry, libraries can be quite big. (some corporations have Linux libraries of several hundred megabytes of code).
The gold
linker from package binutils-gold
on Debian should be useful to you. It works faster than the older linker from binutils
.