This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[patch RFA] Tweak a few ld tests for sh64*-elf
- From: Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- To: binutils at sourceware dot org
- Date: Tue, 15 Sep 2009 08:29:39 +0900 (JST)
- Subject: [patch RFA] Tweak a few ld tests for sh64*-elf
Hi,
Some ld tests fails on sh64-unknown-elf.
> FAIL: size/aligment change of common symbols (change 1)
> FAIL: size/aligment change of common symbols (change 2)
> FAIL: Check --gc-section
> FAIL: Check --gc-section/-q
> FAIL: Check --gc-section/-r/-e
> FAIL: Check --gc-section/-r/-u
Those tests use the target compiler to get object files.
sh64-elf compiler adds the appropriate emulation option when
invoking ld, but those tests invoke ld without that option.
The tests fail because the default ld emulation is different
with that option. First I've tried is to change the default
emulation of sh64-elf ld, but it broke many assumption on
this target. The attached patch simply adds the appropriate
emulation option to those tests for sh64*.
The patch is tested on the native i686-pc-linux-gnu build with
--enable-targets=all.
OK for HEAD and 2.20 branch?
Regards,
kaz
--
2009-09-14 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* ld-elfcomm/elfcomm.exp: Add appropriate emulation option
for sh64*-*-*.
* ld-gc/gc.exp (test_gc): Likewise.
diff -uprN ORIG/src/ld/testsuite/ld-elfcomm/elfcomm.exp src/ld/testsuite/ld-elfcomm/elfcomm.exp
--- ORIG/src/ld/testsuite/ld-elfcomm/elfcomm.exp 2009-09-06 12:55:23.000000000 +0900
+++ src/ld/testsuite/ld-elfcomm/elfcomm.exp 2009-09-14 09:02:53.000000000 +0900
@@ -1,5 +1,6 @@
# Expect script for common symbol tests
-# Copyright 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# Copyright 2003, 2005, 2006, 2007, 2008, 2009
+# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
@@ -185,7 +186,18 @@ if { ![ld_compile "$CC $CFLAGS" $srcdi
global ld
global link_output
-if { [ld_simple_link $ld tmpdir/common1.o "-r tmpdir/common1a.o tmpdir/common1b.o"] } {
+set options "-r tmpdir/common1a.o tmpdir/common1b.o"
+
+# SH64 targets needs an extra ld option for this test.
+if [istarget sh64*-*-*] {
+ if [istarget sh64*l*-*-*] {
+ set options "-mshlelf32 $options"
+ } else {
+ set options "-mshelf32 $options"
+ }
+}
+
+if { [ld_simple_link $ld tmpdir/common1.o $options] } {
unresolved $test1w1
return
}
@@ -211,7 +223,18 @@ if { [dump_common1 $test1c1] } {
pass $test1c1
}
-if { [ld_simple_link $ld tmpdir/common1.o "-r tmpdir/common1b.o tmpdir/common1a.o"] } {
+set options "-r tmpdir/common1b.o tmpdir/common1a.o"
+
+# SH64 targets needs an extra ld option for this test.
+if [istarget sh64*-*-*] {
+ if [istarget sh64*l*-*-*] {
+ set options "-mshlelf32 $options"
+ } else {
+ set options "-mshelf32 $options"
+ }
+}
+
+if { [ld_simple_link $ld tmpdir/common1.o $options] } {
unresolved $test1w2
return
}
diff -uprN ORIG/src/ld/testsuite/ld-gc/gc.exp src/ld/testsuite/ld-gc/gc.exp
--- ORIG/src/ld/testsuite/ld-gc/gc.exp 2008-09-12 09:01:39.000000000 +0900
+++ src/ld/testsuite/ld-gc/gc.exp 2009-09-14 09:06:59.000000000 +0900
@@ -1,5 +1,5 @@
# Expect script for ld-gc tests
-# Copyright 2008
+# Copyright 2008, 2009
# Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
@@ -44,8 +44,18 @@ proc test_gc { testname filename linker
}
set outfile "tmpdir/$filename"
+ set options "-L$srcdir/$subdir $ldflags $objfile"
- if ![ld_simple_link $linker $outfile "-L$srcdir/$subdir $ldflags $objfile"] {
+ # SH64 targets needs an extra ld option for this test.
+ if [istarget sh64*-*-*] {
+ if [istarget sh64*l*-*-*] {
+ set options "-mshlelf32 $options"
+ } else {
+ set options "-mshelf32 $options"
+ }
+ }
+
+ if ![ld_simple_link $linker $outfile $options] {
fail $testname
return
}