Consider the following trivial test program: int main (void) { gethostbyname(); }
Compiling and linking it with gcc 4.3.0 20070618 configured with gas and gld 2.17 fails: ./collect2 -V -m elf_i386 -Y P,/usr/ccs/lib:/usr/lib -Qy -o ghn /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/values-Xa.o ./crtbegin.o -L. /var/tmp//ccQzeTUf.o -lnsl -lgcc -lgcc_eh -lc -lgcc -lgcc_eh ./crtend.o /usr/lib/crtn.o GNU ld version 2.17 Supported emulations: elf_i386_ldso elf_i386 elf_x86_64 /vol/gcc/lib/gld-2.17: warning: libmp.so.2, needed by /usr/lib/libnsl.so, not found (try using -rpath or -rpath-link) /vol/gcc/lib/gld-2.17: warning: libmd5.so.1, needed by /usr/lib/libnsl.so, not found (try using -rpath or -rpath-link) /vol/gcc/lib/gld-2.17: warning: libscf.so.1, needed by /usr/lib/libnsl.so, not found (try using -rpath or -rpath-link) /usr/lib/libnsl.so: undefined reference to `scf_simple_prop_get' /usr/lib/libnsl.so: undefined reference to `smf_enable_instance' /usr/lib/libnsl.so: undefined reference to `mp_madd' /usr/lib/libnsl.so: undefined reference to `mp_sdiv' /usr/lib/libnsl.so: undefined reference to `scf_simple_prop_free' /usr/lib/libnsl.so: undefined reference to `MD5Final' /usr/lib/libnsl.so: undefined reference to `mp_mtox' /usr/lib/libnsl.so: undefined reference to `mp_mfree' /usr/lib/libnsl.so: undefined reference to `MD5Init' /usr/lib/libnsl.so: undefined reference to `mp_itom' /usr/lib/libnsl.so: undefined reference to `smf_get_state' /usr/lib/libnsl.so: undefined reference to `MD5Update' /usr/lib/libnsl.so: undefined reference to `mp_mult' /usr/lib/libnsl.so: undefined reference to `mp_pow' /usr/lib/libnsl.so: undefined reference to `scf_simple_prop_next_boolean' /usr/lib/libnsl.so: undefined reference to `_mp_move' /usr/lib/libnsl.so: undefined reference to `mp_xtom' /usr/lib/libnsl.so: undefined reference to `mp_mdiv' collect2: ld returned 1 exit status Adding -rpath-link /lib works around this, but given that /lib is a standard SEARCH_DIR, this seems wrong. I found that adding -m elf_i386_ldso works, too. Even GCC 4.3.0 still passes -m elf_i386 by default, so the fact that only the elf_i386_ldso emulation supports SEARCH_DIRS other than $prefix/... seems a bug. -- Summary: gld fails to link Solaris 10/x86 libnsl.so Product: binutils Version: 2.17 Status: NEW Severity: normal Priority: P2 Component: ld AssignedTo: unassigned at sources dot redhat dot com ReportedBy: ro at TechFak dot Uni-Bielefeld dot DE CC: bug-binutils at gnu dot org GCC build triplet: i386-pc-solaris2.10 GCC host triplet: i386-pc-solaris2.10 GCC target triplet: i386-pc-solaris2.10 http://sourceware.org/bugzilla/show_bug.cgi?id=4715 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils