This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
sysroot change broke ld.so.conf handling
- From: Andreas Jaeger <aj at suse dot de>
- To: binutils at sources dot redhat dot com
- Date: Fri, 17 Jan 2003 11:00:33 +0100
- Subject: sysroot change broke ld.so.conf handling
I just tried running the testsuite on linux-x86_64 and got this
failure in the ld testsuite:
Running /usr/src/aj/Hunt-GCC/src-binutils/src/ld/testsuite/ld-bootstrap/bootstrap.exp ...
/usr/src/aj/Hunt-GCC/build/ld/ld-new -m elf_x86_64 -o tmpdir/ld-partial.o -r ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf_x86_64.o eelf_i386.o ei386linux.o
/usr/src/aj/Hunt-GCC/build/ld/ld-new -m elf_x86_64 -o tmpdir/ld1 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib64/crt1.o /usr/lib64/crti.o ../gcc/crtbegin.o tmpdir/ld-partial.o ../bfd/.libs/libbfd.a ../libiberty/libiberty.a -L/usr/lib64 ../gcc/libgcc.a ../gcc/libgcc_eh.a -lc ../gcc/libgcc.a ../gcc/libgcc_eh.a ../gcc/crtend.o /usr/lib64/crtn.o
lt-ld-new: warning: ld-linux-x86-64.so.2, needed by /lib64/libc.so.6, not found (try using -rpath or -rpath-link)
/lib64/libc.so.6: undefined reference to `_dl_lookup_versioned_symbol_skip@GLIBC_PRIVATE'
/lib64/libc.so.6: undefined reference to `_rtld_global@GLIBC_PRIVATE'
[...more undefined references...]
Running strace shows:
open("/etc/ld.so.conf", O_RDONLY) = 8
fstat(8, {st_mode=S_IFREG|0644, st_size=430, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a95613000
read(8, "/usr/X11R6/lib64/Xaw95\n/usr/X11R"..., 4096) = 430
read(8, "", 4096) = 0
close(8) = 0
munmap(0x2a95613000, 4096) = 0
open("/usr/X11R6/lib64/Xaw95/usr/X11R6/lib64/Xaw3d/usr/X11R6/lib64/usr/X11R6/lib/Xaw95/usr/X11R6/lib/Xaw3d/usr/X11R6/lib/usr/
x86_64-suse-linux/lib64/usr/x86_64-suse-linux/lib/usr/local/lib/usr/openwin/lib/opt/kde/lib/opt/kde2/lib/opt/kde3/lib/opt/gno
me/lib/opt/gnome2/lib/lib64/lib/usr/lib64/usr/lib/usr/local/lib64/usr/openwin/lib64/opt/kde/lib64/opt/kde2/lib64/opt/kde3/lib
64/opt/gnome/lib64/opt/gnome2/lib64/ld-linux-x86-64.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
The problem was that all colons were removed from the path. The
appended patch fixes this. Ok to commmit?
Andreas
2003-01-17 Andreas Jaeger <aj@suse.de>
* emultempl/elf32.em (gld${EMULATION_NAME}_add_sysroot): Do not
skip ':'.
============================================================
Index: ld/emultempl/elf32.em
--- emultempl/elf32.em 6 Jan 2003 16:14:01 -0000 1.88
+++ emultempl/elf32.em 17 Jan 2003 09:59:35 -0000
@@ -471,9 +471,9 @@ gld${EMULATION_NAME}_add_sysroot (path)
while (path[i])
if (path[i] == ':')
{
+ *p++ = path[i++];
strcpy (p, ld_sysroot);
p = p + strlen (p);
- i++;
}
else
*p++ = path[i++];
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj