This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

More MIPS testsuite fixes


hidden2 needs to use .type, because MIPS defaults to OBJECT.  It also needs
to place .dynamic; this is because the PT_DYNAMIC segment on MIPS includes
.dynsym, and orphan placement will happen to place .dynamic after .dynsym,
which ld complains about.

ld-elf/start.s needs to provide __start since that's the default entry point
on MIPS.

warn1.d needs to use a linker script without SIZEOF_HEADERS, because
mips-linux will have a SEC_ALLOC reginfo section, which the linker script
places up after 0x400000.  So we run out of program headers.  Using group.ld
should handle the Alpha case as well as -Ttext did.  Alan, I gather you have
a list of targets that you run through the testsuite for; could you add
mips-linux?

Is the patch OK?

-- 
Daniel Jacobowitz
CodeSourcery, LLC

2005-02-21  Daniel Jacobowitz  <dan@codesourcery.com>

	* ld-elfvsb/hidden2.d: Expect OBJECT.
	* ld-elfvsb/hidden2.s: Force type OBJECT.
	* ld-elfvsb/hidden2.ld: Place .dynamic explicitly.
	* ld-elf/start.s: Provide __start for MIPS.
	* ld-elfcomm/elfcomm.exp: Accept MIPS common section.  XFAIL size change
	test.
	* ld-elf/warn1.d: Use group.ld instead of -Ttext.

Index: binutils/ld/testsuite/ld-elfvsb/hidden2.d
===================================================================
--- binutils.orig/ld/testsuite/ld-elfvsb/hidden2.d	2005-02-10 09:09:43.000000000 -0500
+++ binutils/ld/testsuite/ld-elfvsb/hidden2.d	2005-02-21 09:38:31.167154608 -0500
@@ -5,5 +5,5 @@
 
 Symbol table for image:
 #...
-[ 	]*[0-9]+ +[0-9]+: [0-9a-fA-F]* +0  NOTYPE  LOCAL HIDDEN +ABS foo
+[ 	]*[0-9]+ +[0-9]+: [0-9a-fA-F]* +0  OBJECT  LOCAL HIDDEN +ABS foo
 #pass
Index: binutils/ld/testsuite/ld-elfvsb/hidden2.ld
===================================================================
--- binutils.orig/ld/testsuite/ld-elfvsb/hidden2.ld	2005-02-14 11:54:32.000000000 -0500
+++ binutils/ld/testsuite/ld-elfvsb/hidden2.ld	2005-02-21 09:38:31.167154608 -0500
@@ -3,4 +3,5 @@ SECTIONS
   . = 0x1000;
   PROVIDE (foo = .);
   .data : { *(.data) }
+  .dynamic : { *(.dynamic) }
 }
Index: binutils/ld/testsuite/ld-elfvsb/hidden2.s
===================================================================
--- binutils.orig/ld/testsuite/ld-elfvsb/hidden2.s	2005-02-21 09:37:18.221944952 -0500
+++ binutils/ld/testsuite/ld-elfvsb/hidden2.s	2005-02-21 09:38:49.649752748 -0500
@@ -1,4 +1,5 @@
 	.data
 	.hidden foo
 	.global foo
+	.type foo,%object
 	.dc.a foo
Index: binutils/ld/testsuite/ld-elf/start.s
===================================================================
--- binutils.orig/ld/testsuite/ld-elf/start.s	2005-02-06 21:46:15.000000000 -0500
+++ binutils/ld/testsuite/ld-elf/start.s	2005-02-21 09:38:31.168154425 -0500
@@ -1,4 +1,6 @@
 	.text
 	.global _start
 _start:
+	.global __start
+__start:
 	.long 0
Index: binutils/ld/testsuite/ld-elfcomm/elfcomm.exp
===================================================================
--- binutils.orig/ld/testsuite/ld-elfcomm/elfcomm.exp	2003-06-17 23:38:05.000000000 -0400
+++ binutils/ld/testsuite/ld-elfcomm/elfcomm.exp	2005-02-21 09:38:31.168154425 -0500
@@ -45,7 +45,7 @@ proc dump_common1 { testname } {
 
     send_log "$READELF -s tmpdir/common1.o | grep foo\n"
     catch "exec $READELF -s tmpdir/common1.o | grep foo" exec_output
-    if { ![regexp "(\[ 	\]*)(\[0-9\]+):(\[ 	\]*)(\[0\]*)80(\[ 	\]+)4(\[ 	\]+)OBJECT(\[ 	\]+)GLOBAL(\[ 	\]+)DEFAULT(\[ 	\]+)COM(\[ 	\]+)_?foo2" $exec_output]
+    if { ![regexp "(\[ 	\]*)(\[0-9\]+):(\[ 	\]*)(\[0\]*)80(\[ 	\]+)4(\[ 	\]+)OBJECT(\[ 	\]+)GLOBAL(\[ 	\]+)DEFAULT(\[ 	\]+)(PRC\\\[0xff03\\\]|COM)(\[ 	\]+)_?foo2" $exec_output]
  	 || ![regexp "(\[ 	\]*)(\[0-9\]+):(\[ 	\]*)(\[0-9\]+)(\[ 	\]+)21(\[ 	\]+)OBJECT(\[ 	\]+)GLOBAL(\[ 	\]+)DEFAULT(\[ 	\]+)(\[0-9\]+)(\[ 	\]+)_?foo1" $exec_output] } {
 	send_log "$exec_output\n"
 	verbose $exec_output
@@ -72,7 +72,13 @@ if { [ld_simple_link $ld tmpdir/common1.
 
 if { ![regexp "Warning: alignment (\[0-9\]+) of symbol \`_?foo1\' in tmpdir/common1b.o is smaller than 64 in tmpdir/common1a.o" $link_output]
      || ![regexp "Warning: size of symbol \`_?foo1\' changed from 2 in tmpdir/common1a.o to 21 in tmpdir/common1b.o" $link_output] } {
-    fail $test1w1
+    if { [istarget mips*-*-*] } {
+	# This test fails on MIPS because the backend sets type_change_ok.  The
+	# size change warning is suppressed.
+	xfail $test1w1
+    } else {
+	fail $test1w1
+    }
 } else {
     pass $test1w1
 }
Index: binutils/ld/testsuite/ld-elf/warn1.d
===================================================================
--- binutils.orig/ld/testsuite/ld-elf/warn1.d	2005-02-21 09:37:17.218112989 -0500
+++ binutils/ld/testsuite/ld-elf/warn1.d	2005-02-21 10:39:19.599477177 -0500
@@ -1,7 +1,7 @@
 #source: start.s
 #source: symbol1ref.s
 #source: symbol1w.s
-#ld: -Ttext 0x1000
+#ld: -T group.ld
 #warning: ^[^\\n]*\): warning: witty one-liner$
 #readelf: -s
 #notarget: "sparc64-*-solaris2*" "sparcv9-*-solaris2*"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]