[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Why is order of input files important for ld?



Miro Kropáček wrote:
I'd make two global lists, one with provided references, one with
unresolved references and just one simple intersection would do the
job. But what the heck, I must live with that somehow.

One of the side effects of the current classic linker implementation is that it is possible to "override" some .o file from a library with another .o specifically put on the linker command line, before the library.

For example, if, in your own program, you define a function named sin() then you link with -lm, the sin.o from libm.a will not be linked in (since it does not satisfy any unsatisfied symbol). Any reference to sin() from any library will be resolved to your own implementation.

Please don't ask for more details, I have not experimented this technique myself.

--
Vincent Rivière