This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Changed behaviour of --as-needed
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: binutils at sourceware dot org
- Date: Tue, 28 Mar 2006 08:12:12 +0930
- Subject: Re: Changed behaviour of --as-needed
- References: <jewteg9enk.fsf@sykes.suse.de>
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