aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-elf
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-11-21 13:30:31 +0000
committerAlan Modra <amodra@gmail.com>2002-11-21 13:30:31 +0000
commit782c0ebfc98dfc58a816440d29094a586a78ed7d (patch)
tree78896d84013a5f564a577bd5ee05c613023bea9e /ld/testsuite/ld-elf
parentdc12c51f36d7fc8ccdc98a9b266b5ef58668da39 (diff)
downloadgdb-782c0ebfc98dfc58a816440d29094a586a78ed7d.zip
gdb-782c0ebfc98dfc58a816440d29094a586a78ed7d.tar.gz
gdb-782c0ebfc98dfc58a816440d29094a586a78ed7d.tar.bz2
* 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.
Diffstat (limited to 'ld/testsuite/ld-elf')
-rw-r--r--ld/testsuite/ld-elf/elf.exp (renamed from ld/testsuite/ld-elf/sec64k.exp)17
-rw-r--r--ld/testsuite/ld-elf/merge.d14
-rw-r--r--ld/testsuite/ld-elf/merge.ld7
-rw-r--r--ld/testsuite/ld-elf/merge.s14
4 files changed, 48 insertions, 4 deletions
diff --git a/ld/testsuite/ld-elf/sec64k.exp b/ld/testsuite/ld-elf/elf.exp
index bfc6d0f..0914695 100644
--- a/ld/testsuite/ld-elf/sec64k.exp
+++ b/ld/testsuite/ld-elf/elf.exp
@@ -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
index 0000000..cbefcaf
--- /dev/null
+++ b/ld/testsuite/ld-elf/merge.d
@@ -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
index 0000000..dce91bb
--- /dev/null
+++ b/ld/testsuite/ld-elf/merge.ld
@@ -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
index 0000000..1e6e0e3
--- /dev/null
+++ b/ld/testsuite/ld-elf/merge.s
@@ -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