bug-binutils
[Top][All Lists]
Advanced

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

Re: ld fails to link if library order is reversed


From: Ian Lance Taylor
Subject: Re: ld fails to link if library order is reversed
Date: 07 Mar 2005 15:25:59 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Nilmoni Deb <address@hidden> writes:

> Lets say I am running the following command
> 
>       gcc z.o -lX -lY -o z
> 
> and libX.a depends on a function that is defined in libY.a then the order
> of linking appears to be important. While the previous command works, the
> next one (with order reversed) will fail:
> 
>       gcc z.o -lY -lX -o z
> 
> This problem has been observed with binutils version 2.10.91. I would
> think that ld should look back when resolving dependencies.

This is correct and documented behaviour.  All Unix linkers behave
this way.

Ian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]