aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-visium
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2014-12-06 16:45:22 +0100
committerEric Botcazou <ebotcazou@gcc.gnu.org>2014-12-06 16:45:22 +0100
commitc18392d87d22191584d76f7b4a850eb9508a8f04 (patch)
treea31b29449dd6f68dd41d55932f4ec1c3d8c51a1c /ld/testsuite/ld-visium
parentb6605dddac58805d735211f0d38805bf87b6db04 (diff)
downloadgdb-c18392d87d22191584d76f7b4a850eb9508a8f04.zip
gdb-c18392d87d22191584d76f7b4a850eb9508a8f04.tar.gz
gdb-c18392d87d22191584d76f7b4a850eb9508a8f04.tar.bz2
Add Visium support to ld
ld/ * configure.tgt: Add Visium support. * Makefile.am (ALL_EMULATION_SOURCES): Add eelf32visium.c. (eelf32visium.c): New rule. * Makefile.in: Regenerate. * emulparams/elf32visium.sh: New file. * scripttempl/visium.sc: Likewise. ld/testsuite/ * lib/ld-lib.exp (check_shared_lib_support): Return 0 for Visium. * ld-visium/: New directory.
Diffstat (limited to 'ld/testsuite/ld-visium')
-rw-r--r--ld/testsuite/ld-visium/brr_x_backward.d4
-rw-r--r--ld/testsuite/ld-visium/brr_x_backward1.s6
-rw-r--r--ld/testsuite/ld-visium/brr_x_backward2.s7
-rw-r--r--ld/testsuite/ld-visium/brr_x_forward.d4
-rw-r--r--ld/testsuite/ld-visium/brr_x_forward1.s7
-rw-r--r--ld/testsuite/ld-visium/brr_x_forward2.s6
-rw-r--r--ld/testsuite/ld-visium/brr_x_seg.s9
-rw-r--r--ld/testsuite/ld-visium/brr_x_seg1.d3
-rw-r--r--ld/testsuite/ld-visium/brr_x_seg2.d3
-rw-r--r--ld/testsuite/ld-visium/imm_x_seg.d3
-rw-r--r--ld/testsuite/ld-visium/imm_x_seg.s8
-rw-r--r--ld/testsuite/ld-visium/ld1.ld9
-rw-r--r--ld/testsuite/ld-visium/ld2.ld9
-rw-r--r--ld/testsuite/ld-visium/ld3.ld9
-rw-r--r--ld/testsuite/ld-visium/reloc.d14
-rw-r--r--ld/testsuite/ld-visium/reloc1.s24
-rw-r--r--ld/testsuite/ld-visium/reloc2.s12
-rw-r--r--ld/testsuite/ld-visium/visium.exp30
18 files changed, 167 insertions, 0 deletions
diff --git a/ld/testsuite/ld-visium/brr_x_backward.d b/ld/testsuite/ld-visium/brr_x_backward.d
new file mode 100644
index 0000000..543e912
--- /dev/null
+++ b/ld/testsuite/ld-visium/brr_x_backward.d
@@ -0,0 +1,4 @@
+#source: brr_x_backward1.s
+#source: brr_x_backward2.s
+#ld:
+#error: relocation truncated to fit: R_VISIUM_PC16
diff --git a/ld/testsuite/ld-visium/brr_x_backward1.s b/ld/testsuite/ld-visium/brr_x_backward1.s
new file mode 100644
index 0000000..03542f2
--- /dev/null
+++ b/ld/testsuite/ld-visium/brr_x_backward1.s
@@ -0,0 +1,6 @@
+ .text
+ .global start
+start:
+ .global L1,L2
+L1: nop
+L2:
diff --git a/ld/testsuite/ld-visium/brr_x_backward2.s b/ld/testsuite/ld-visium/brr_x_backward2.s
new file mode 100644
index 0000000..ef15268bf
--- /dev/null
+++ b/ld/testsuite/ld-visium/brr_x_backward2.s
@@ -0,0 +1,7 @@
+ .text
+ .rept 32767
+ nop
+ .endr
+ brr tr,L1
+ nop
+ brr tr,L2
diff --git a/ld/testsuite/ld-visium/brr_x_forward.d b/ld/testsuite/ld-visium/brr_x_forward.d
new file mode 100644
index 0000000..29adf74
--- /dev/null
+++ b/ld/testsuite/ld-visium/brr_x_forward.d
@@ -0,0 +1,4 @@
+#source: brr_x_forward1.s
+#source: brr_x_forward2.s
+#ld:
+#error: relocation truncated to fit: R_VISIUM_PC16
diff --git a/ld/testsuite/ld-visium/brr_x_forward1.s b/ld/testsuite/ld-visium/brr_x_forward1.s
new file mode 100644
index 0000000..34fddf8
--- /dev/null
+++ b/ld/testsuite/ld-visium/brr_x_forward1.s
@@ -0,0 +1,7 @@
+ .text
+ brr tr,L1
+ nop
+ brr tr,L2
+ .rept 32765
+ nop
+ .endr
diff --git a/ld/testsuite/ld-visium/brr_x_forward2.s b/ld/testsuite/ld-visium/brr_x_forward2.s
new file mode 100644
index 0000000..65e3dae
--- /dev/null
+++ b/ld/testsuite/ld-visium/brr_x_forward2.s
@@ -0,0 +1,6 @@
+ .global start
+ .global L1,L2
+ .text
+start:
+L1: nop
+L2:
diff --git a/ld/testsuite/ld-visium/brr_x_seg.s b/ld/testsuite/ld-visium/brr_x_seg.s
new file mode 100644
index 0000000..8a55711
--- /dev/null
+++ b/ld/testsuite/ld-visium/brr_x_seg.s
@@ -0,0 +1,9 @@
+ .text
+ nop
+ brr tr,L1
+ nop
+ .data
+ .global start
+start:
+ .long 0
+L1:
diff --git a/ld/testsuite/ld-visium/brr_x_seg1.d b/ld/testsuite/ld-visium/brr_x_seg1.d
new file mode 100644
index 0000000..ace1028
--- /dev/null
+++ b/ld/testsuite/ld-visium/brr_x_seg1.d
@@ -0,0 +1,3 @@
+#source: brr_x_seg.s
+#ld: -T ld1.ld
+#error: relocation truncated to fit: R_VISIUM_PC16
diff --git a/ld/testsuite/ld-visium/brr_x_seg2.d b/ld/testsuite/ld-visium/brr_x_seg2.d
new file mode 100644
index 0000000..9441d86
--- /dev/null
+++ b/ld/testsuite/ld-visium/brr_x_seg2.d
@@ -0,0 +1,3 @@
+#source: brr_x_seg.s
+#ld: -T ld2.ld
+#error: relocation truncated to fit: R_VISIUM_PC16
diff --git a/ld/testsuite/ld-visium/imm_x_seg.d b/ld/testsuite/ld-visium/imm_x_seg.d
new file mode 100644
index 0000000..d52fb7e
--- /dev/null
+++ b/ld/testsuite/ld-visium/imm_x_seg.d
@@ -0,0 +1,3 @@
+#source: imm_x_seg.s
+#ld: -T ld3.ld
+#error: relocation truncated to fit: R_VISIUM_IM16_PCREL
diff --git a/ld/testsuite/ld-visium/imm_x_seg.s b/ld/testsuite/ld-visium/imm_x_seg.s
new file mode 100644
index 0000000..d490b6f
--- /dev/null
+++ b/ld/testsuite/ld-visium/imm_x_seg.s
@@ -0,0 +1,8 @@
+ .section seg1
+foo:
+ nop
+ moviq r6,bar-foo
+
+ .section seg2
+bar:
+ .end
diff --git a/ld/testsuite/ld-visium/ld1.ld b/ld/testsuite/ld-visium/ld1.ld
new file mode 100644
index 0000000..fc33cf8
--- /dev/null
+++ b/ld/testsuite/ld-visium/ld1.ld
@@ -0,0 +1,9 @@
+SECTIONS
+{
+ .text 0x10000 : {
+ *(.text)
+ }
+ .data 0x30000 : {
+ *(.data)
+ }
+}
diff --git a/ld/testsuite/ld-visium/ld2.ld b/ld/testsuite/ld-visium/ld2.ld
new file mode 100644
index 0000000..74f399a
--- /dev/null
+++ b/ld/testsuite/ld-visium/ld2.ld
@@ -0,0 +1,9 @@
+SECTIONS
+{
+ .text 0x30004 : {
+ *(.text)
+ }
+ .data 0x10000 : {
+ *(.data)
+ }
+}
diff --git a/ld/testsuite/ld-visium/ld3.ld b/ld/testsuite/ld-visium/ld3.ld
new file mode 100644
index 0000000..e3934cd
--- /dev/null
+++ b/ld/testsuite/ld-visium/ld3.ld
@@ -0,0 +1,9 @@
+SECTIONS
+{
+ seg1 0x10000 : {
+ *(seg1)
+ }
+ seg2 0x20000 : {
+ *(seg2)
+ }
+}
diff --git a/ld/testsuite/ld-visium/reloc.d b/ld/testsuite/ld-visium/reloc.d
new file mode 100644
index 0000000..bca5817
--- /dev/null
+++ b/ld/testsuite/ld-visium/reloc.d
@@ -0,0 +1,14 @@
+#source: reloc1.s
+#source: reloc2.s
+#ld: -T ld1.ld
+#objdump: -s
+
+.*: +file format .*
+
+Contents of section .text:
+ 10000 00000000 7800000a 84c20034 8482003c ....x......4...<
+ 10010 84a20001 84c20002 0442002c 84020002 .........B.,....
+ 10020 0482002c 84a20002 84c21000 ...,........
+Contents of section .data:
+ 30000 00140014 00000014 0001002c 0002002c ...........,...,
+ 30010 10001010 ....
diff --git a/ld/testsuite/ld-visium/reloc1.s b/ld/testsuite/ld-visium/reloc1.s
new file mode 100644
index 0000000..41be3de
--- /dev/null
+++ b/ld/testsuite/ld-visium/reloc1.s
@@ -0,0 +1,24 @@
+ .data
+foo:
+ .byte 0
+ .byte data1-foo
+ .word data1-foo
+ .long data1-foo
+ .long text1
+ .long text2
+ .word abs1
+ .word abs1+0x10
+ .text
+bar:
+ nop
+ brr tr,text1
+ moviq r2,text1-bar+8
+ movil r2,%l text2-bar+16
+ moviu r2,%u text2-bar+16
+ moviq r2,%u text2
+ subi r2,%l text2
+ addi r2,%u text2
+ movil r2, text2 ; with movil, the %l may be omitted
+ moviu r2,%u text2
+ moviq r2,abs1
+ .end
diff --git a/ld/testsuite/ld-visium/reloc2.s b/ld/testsuite/ld-visium/reloc2.s
new file mode 100644
index 0000000..517d977
--- /dev/null
+++ b/ld/testsuite/ld-visium/reloc2.s
@@ -0,0 +1,12 @@
+ .global abs1
+abs1 = 0x1000
+
+ .data
+ .global data1
+data1:
+ .text
+ .global text1
+text1:
+ .global text2
+text2 = . + 65536
+ .end
diff --git a/ld/testsuite/ld-visium/visium.exp b/ld/testsuite/ld-visium/visium.exp
new file mode 100644
index 0000000..c61467c
--- /dev/null
+++ b/ld/testsuite/ld-visium/visium.exp
@@ -0,0 +1,30 @@
+# Expect script for Visium tests.
+# Copyright (C) 2014 Free Software Foundation, Inc.
+#
+# This file is part of the GNU Binutils.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+# MA 02110-1301, USA.
+
+# Visium linker testsuite.
+
+if [istarget visium-*-*] {
+ run_dump_test "brr_x_backward"
+ run_dump_test "brr_x_forward"
+ run_dump_test "brr_x_seg1"
+ run_dump_test "brr_x_seg2"
+ run_dump_test "imm_x_seg"
+ run_dump_test "reloc"
+}