This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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: linker problem


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 


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