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

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



Hi,

today I for 1000th time bumped into this and this time I'm not going to rest until someone gives me damn good explanation :) For some reason, one must always (?) link files in this order:

ld <my_obj_files> <my library files> for example:

ld main.o math_stuff.o -o output -lm

if I do it in opposite way:

ld -lm main.o math_stuff.o -o output

stuff from libm.a isn't found. Ok, I could live with that. But how it's possible it works in linux? It's due to inlining? (since our math library is broken for 68881 and if I understood it right, 68881 code was never used).

Really, really annoying.

--
MiKRO / Mystic Bytes
http://mikro.atari.org