This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Changed behaviour of --as-needed
- From: Andreas Schwab <schwab at suse dot de>
- To: Alan Modra <amodra at bigpond dot net dot au>
- Cc: binutils at sourceware dot org
- Date: Mon, 27 Mar 2006 15:54:23 +0200
- Subject: Changed behaviour of --as-needed
Given the following files:
$ cat liba.c
extern double log (double);
int a (double b) { return log (b); }
$ cat main.c
extern int a (double);
int main (void)
{
a (1.0);
return 0;
}
$ gcc -o liba.so -shared liba.c
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?
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."