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

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



On Fri, 2011-01-21 at 11:21 +0100, Miro Kropáček wrote:
> 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.

I believe it's because we are stuck with static libs, and the way
symbols are resolved in static libraries.

Alan.