This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: Changed behaviour of --as-needed


On Mon, Mar 27, 2006 at 03:54:23PM +0200, Andreas Schwab wrote:
> Note that liba.so is not linked against -lm.  Now when trying to link them
> together while using --as-needed, I get an undefined references:
> 
> $ gcc main.o liba.so -Wl,-as-needed -lm
> liba.so: undefined reference to `log'
> 
> This is a side effect of the patch for PR 2434.  Is this the intended
> behaviour?

Yes.  Prior to the PR2434 fix, the link would proceed but at runtime
you would get an error.

$ LD_LIBRARY_PATH=. ./a.out
./a.out: relocation error: ./liba.so: undefined symbol: log

Not reporting the undefined symbol at link time was simply a bug.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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