OSDN Git Service

* ld-elf/elf.exp: Renamed from sec64k.exp. Add test_list loop.
authorAlan Modra <amodra@bigpond.net.au>
Thu, 21 Nov 2002 13:30:31 +0000 (13:30 +0000)
committerAlan Modra <amodra@bigpond.net.au>
Thu, 21 Nov 2002 13:30:31 +0000 (13:30 +0000)
* ld-elf/merge.s: New file.
* ld-elf/merge.d: New file.
* ld-elf/merge.ld: New file.

ld/testsuite/ChangeLog
ld/testsuite/ld-elf/elf.exp [moved from ld/testsuite/ld-elf/sec64k.exp with 91% similarity]
ld/testsuite/ld-elf/merge.d [new file with mode: 0644]
ld/testsuite/ld-elf/merge.ld [new file with mode: 0644]
ld/testsuite/ld-elf/merge.s [new file with mode: 0644]

index 0fe80b0..09e1f12 100644 (file)
@@ -1,3 +1,10 @@
+2002-11-21  Alan Modra  <amodra@bigpond.net.au>
+
+       * ld-elf/elf.exp: Renamed from sec64k.exp.  Add test_list loop.
+       * ld-elf/merge.s: New file.
+       * ld-elf/merge.d: New file.
+       * ld-elf/merge.ld: New file.
+
 2002-11-18  Svein E. Seldal  <Svein.Seldal@solidas.com>
 
        * ld-scripts/script.exp: Setup for tic4x testcase
similarity index 91%
rename from ld/testsuite/ld-elf/sec64k.exp
rename to ld/testsuite/ld-elf/elf.exp
index bfc6d0f..0914695 100644 (file)
@@ -1,4 +1,4 @@
-# Expect script for tests for >64k sections
+# Expect script for various ELF tests.
 #   Copyright 2002 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
@@ -32,15 +32,24 @@ if { [istarget *-*-linux*aout*] \
     return
 }
 
+set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
+foreach t $test_list {
+    # We need to strip the ".d", but can leave the dirname.
+    verbose [file rootname $t]
+    run_dump_test [file rootname $t]
+}
+
+
+# Test >64k sections, with and without -r.
+
 # Per-port excludes, since this test takes an overwhelmingly long time
 # currently.
 if { ![istarget cris-*-*] } {
     return
 }
 
-# Test >64k sections, with and without -r.  First, create the assembly
-# files.  Have a relocation to another section and one within the local
-# section.
+# First, create the assembly files.  Have a relocation to another
+# section and one within the local section.
 
 set test1 "64ksec-r"
 set test2 "64ksec"
diff --git a/ld/testsuite/ld-elf/merge.d b/ld/testsuite/ld-elf/merge.d
new file mode 100644 (file)
index 0000000..cbefcaf
--- /dev/null
@@ -0,0 +1,14 @@
+#source: merge.s
+#ld: -T merge.ld
+#objdump: -s
+#xfail: "arc-*-*" "avr-*-*" "cris-*-*" "dlx-*-*" "fr30-*-*" "frv-*-*"
+#xfail: "hppa*-*-*" "h8300-*-*" "i960-*-*" "ip2k-*-*" "m32r-*-*" "mcore-*-*"
+#xfail: "mn10*-*-*" "openrisc-*-*" "pj-*-*" "sparc*-*-*"
+
+.*:     file format .*elf.*
+
+Contents of section .text:
+ 1000 (1010)?0000(1010)? (1210)?0000(1012)? (0c)?000000(0c)? (0e)?000000(0e)? .*
+Contents of section .rodata:
+ 1010 61626300 .*
+#pass
diff --git a/ld/testsuite/ld-elf/merge.ld b/ld/testsuite/ld-elf/merge.ld
new file mode 100644 (file)
index 0000000..dce91bb
--- /dev/null
@@ -0,0 +1,7 @@
+SECTIONS
+{
+  . = 0x1000;
+  .text : { *(.text .text.* .gnu.linkonce.t.*) }
+  .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
+  .junk : { *(*) }
+}
diff --git a/ld/testsuite/ld-elf/merge.s b/ld/testsuite/ld-elf/merge.s
new file mode 100644 (file)
index 0000000..1e6e0e3
--- /dev/null
@@ -0,0 +1,14 @@
+       .section .rodata.str,"aMS","progbits",1
+.LC0:
+       .asciz  "abc"
+.LC1:
+       .asciz  "c"
+
+       .text
+       .global _start
+_start:
+       .long   .LC0
+.LT0:
+       .long   .LC1
+       .long   .LC0-.LT0
+       .long   .LC1-.LT0