Patch for ld testsuite

Ken Moffat ken at kenmoffat.uklinux.net
Thu Mar 25 04:06:23 PST 2004


 About time I submitted this.

Ken
-- 
 das eine Mal als Tragödie, das andere Mal als Farce
-------------- next part --------------
Submitted By: Ken Moffat <ken at kenmoffat.uklinux.net>
Date: 2004-03-24
Initial Package Version: 2.14
Upstream Status:  not required for later versions
Origin:  HJL
Description: On ppc, this allows the test suite for `ld' to succeed.  The
alternatives are to use hjl binutils, or ignore the failing tests.

See thread http://archives.linuxfromscratch.org/mail-archives/lfs-dev/2004-February/042262.html
for more details.  Technically applies to all architectures, but most 
of them apparently do not need it.

--- binutils-2.14/ld/testsuite/ld-elfweak/elfweak.exp	2003-06-02 20:35:41.000000000 +0000
+++ binutils-2.14.90.0.8/ld/testsuite/ld-elfweak/elfweak.exp	2003-05-23 14:18:54.000000000 +0000
@@ -270,7 +270,7 @@
 }
 
 proc build_lib {test libname objs dynsymexp} {
-    global ld
+    global CC
     global objdump
     global tmpdir
     global shared
@@ -282,7 +282,7 @@
       set files "$files $tmpdir/$obj"
     }
 
-    if {![ld_link $ld $tmpdir/$libname.so "$shared $files"]} {
+    if {![ld_simple_link $CC $tmpdir/$libname.so "$shared $files"]} {
 	fail $test
 	return
     }
@@ -295,7 +295,7 @@
 }
 
 proc build_exec { test execname objs flags dat dynsymexp symexp} {
-    global ld
+    global CC
     global objdump
     global tmpdir
     global shared
@@ -308,7 +308,7 @@
       set files "$files $tmpdir/$obj"
     }
 
-    if {![ld_link $ld $tmpdir/$execname "$flags $files"]} {
+    if {![ld_simple_link $CC $tmpdir/$execname "$flags $files"]} {
 	fail "$test"
 	return
     }
@@ -392,7 +392,7 @@
     return
 }
 
-if {![ld_link $ld $tmpdir/libbar.so "$shared $tmpdir/bar.o"]} {
+if {![ld_simple_link $CC $tmpdir/libbar.so "$shared $tmpdir/bar.o"]} {
     fail "ELF weak"
     return
 }
@@ -407,17 +407,17 @@
     return
 }
 
-if ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/bar1a.c $tmpdir/bar1a.o] {
+if ![ld_compile "$CC $CFLAGS $picflag" $srcdir/$subdir/bar1a.c $tmpdir/bar1a.o] {
     unresolved "ELF weak"
     return
 }
 
-if ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/bar1b.c $tmpdir/bar1b.o] {
+if ![ld_compile "$CC $CFLAGS $picflag" $srcdir/$subdir/bar1b.c $tmpdir/bar1b.o] {
     unresolved "ELF weak"
     return
 }
 
-if ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/bar1c.c $tmpdir/bar1c.o] {
+if ![ld_compile "$CC $CFLAGS $picflag" $srcdir/$subdir/bar1c.c $tmpdir/bar1c.o] {
     unresolved "ELF weak"
     return
 }
@@ -427,17 +427,17 @@
     return
 }
 
-if {![ld_link $ld $tmpdir/libfoo1a.so "$shared $tmpdir/foo1a.o"]} {
+if {![ld_simple_link $CC $tmpdir/libfoo1a.so "$shared $tmpdir/foo1a.o"]} {
     fail "ELF weak"
     return
 }
 
-if {![ld_link $ld $tmpdir/libfoo1b.so "$shared $tmpdir/foo1b.o"]} {
+if {![ld_simple_link $CC $tmpdir/libfoo1b.so "$shared $tmpdir/foo1b.o"]} {
     fail "ELF weak"
     return
 }
 
-if {![ld_link $ld $tmpdir/libbar1a.so "$shared $tmpdir/bar1a.o $tmpdir/libfoo1a.so"]} {
+if {![ld_simple_link $CC $tmpdir/libbar1a.so "$shared $tmpdir/bar1a.o $tmpdir/libfoo1a.so"]} {
     fail "ELF weak"
     return
 }
@@ -448,8 +448,8 @@
 build_lib "ELF DSO weak func last DSO" libfoo "libbar.so foo.o" dsow.dsym
 build_exec "ELF weak func first" foo "main.o bar.o" "" strong "" strong.sym
 build_exec "ELF weak func last" foo "bar.o main.o" "" strong "" strong.sym
-build_exec "ELF weak func first DSO" foo "main.o libbar.so" "-rpath ." weak weak.dsym ""
-build_exec "ELF weak func last DSO" foo "libbar.so main.o" "-rpath ." weak weak.dsym ""
+build_exec "ELF weak func first DSO" foo "main.o libbar.so" "-Wl,-rpath,." weak weak.dsym ""
+build_exec "ELF weak func last DSO" foo "libbar.so main.o" "-Wl,-rpath,." weak weak.dsym ""
 
 build_lib "ELF DSO weak data first" libfoo "bar1a.o foo1a.o" dsodata.dsym
 build_lib "ELF DSO weak data last" libfoo "foo1a.o bar1a.o" dsodata.dsym
@@ -461,7 +461,7 @@
 build_exec "ELF weak data last" foo "foo1a.o main1.o bar1a.o" "" strongdata "" strongdata.sym
 build_exec "ELF weak data first common" foo "main1.o bar1a.o foo1b.o" "" strongdata "" strongcomm.sym
 build_exec "ELF weak data last common" foo "foo1b.o main1.o bar1a.o" "" strongdata "" strongcomm.sym
-build_exec "ELF weak data first DSO" foo "main1.o libbar1a.so libfoo1a.so" "-rpath ." weakdata weakdata.dsym ""
-build_exec "ELF weak data last DSO" foo "libfoo1a.so main1.o libbar1a.so" "-rpath ." weakdata weakdata.dsym ""
-build_exec "ELF weak data first DSO common" foo "main1.o libbar1a.so libfoo1b.so" "-rpath ." weakdata weakdata.dsym ""
-build_exec "ELF weak data last DSO common" foo "libfoo1b.so main1.o libbar1a.so" "-rpath ." weakdata weakdata.dsym ""
+build_exec "ELF weak data first DSO" foo "main1.o libbar1a.so libfoo1a.so" "-Wl,-rpath,." weakdata weakdata.dsym ""
+build_exec "ELF weak data last DSO" foo "libfoo1a.so main1.o libbar1a.so" "-Wl,-rpath,." weakdata weakdata.dsym ""
+build_exec "ELF weak data first DSO common" foo "main1.o libbar1a.so libfoo1b.so" "-Wl,-rpath,." weakdata weakdata.dsym ""
+build_exec "ELF weak data last DSO common" foo "libfoo1b.so main1.o libbar1a.so" "-Wl,-rpath,." weakdata weakdata.dsym ""


More information about the patches mailing list