The --as-needed behaviour seems to be changed in 2.16: $ readelf -d /usr/lib/libz.so |grep -w NEEDED 0x00000001 (NEEDED) Shared library: [libc.so.6] $ readelf -d /usr/lib/libpng.so |grep -w NEEDED 0x00000001 (NEEDED) Shared library: [libz.so.1] 0x00000001 (NEEDED) Shared library: [libm.so.6] 0x00000001 (NEEDED) Shared library: [libc.so.6] $ gcc -Wall -W zv.c -c When linking with old ld (binutils-2.15.94.0.2.2-2 from FC4): $ gcc zv.o -o zv -Wl,--as-needed -lz $ readelf -d zv |grep -w NEEDED 0x00000001 (NEEDED) Shared library: [libz.so.1] 0x00000001 (NEEDED) Shared library: [libc.so.6] $ gcc zv.o -o zv -Wl,--as-needed -lpng $ readelf -d zv |grep -w NEEDED 0x00000001 (NEEDED) Shared library: [libc.so.6] 0x00000001 (NEEDED) Shared library: [libz.so.1] When linking with new ld (binutils-2.16.91.0.3-2 from FC-devel): $ gcc zv.o -o zv -Wl,--as-needed -lz $ readelf -d zv |grep -w NEEDED 0x00000001 (NEEDED) Shared library: [libz.so.1] 0x00000001 (NEEDED) Shared library: [libc.so.6] $ gcc zv.o -o zv -Wl,--as-needed -lpng zv.o: In function `main': zv.c:(.text+0x23): undefined reference to `zlibVersion' collect2: ld returned 1 exit status Despite of the fact that new behaviour better fits to documentation (http://sourceware.org/ml/binutils/2005-05/msg00611.html), I must say that old behaviour better fits to my needs.
Created attachment 122526 [details] zv.c
Yes, the behaviour changed, but why are you filling it as a bug here? You are free to argue upstream about the change, but we as the distro aren't going to diverge from upstream in this.
1. To ensure this is really upstream change not yours since I tested your packages. 2. To find out your opinion on this change. 3. For reference. Sorry for (ab)using bugzilla.