Plus, if the system is old, the sequence of object files inside a
library is important. Older systems made one pass through the object
files inside a library. That is why there is ranlib. It may be that
no common systems still have this characteristic.
On Apr 25, 2006, at 9:09 AM, John Love-Jensen wrote:
Hi Javier,
I don't think that is a linker problem. I think the linker is
working as
advertised.
Keep in mind that the linker works like this:
1. Open next file in the list, in command line order.
2. .o file? Take in all the symbols, wholesale. Goto 1.
3. .a file? For any current outstanding missing symbols, resolve
them by
the available symbols in the .a file. Take those .o files from
the .a that
match the unresolved symbols (and remove those unresolved symbols
from the
list). Goto 1.
4. .so file? For any current outstanding missing symbols, resolve
them by
the available symbols in the .so file. Remove those unresolved
symbols from
the list, and tag the executable with the load-time dependency on
that .so.
Goto 1.
You'll notice that the resolution of symbols is a single pass,
first come
first serve basis.
So the order of your .a and .so files is of critical importance, if
they
have dependencies on one another.
HTH,
--Eljay