aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-pdp11
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-pdp11')
-rw-r--r--ld/testsuite/ld-pdp11/imagic.d12
-rw-r--r--ld/testsuite/ld-pdp11/imagicz.d12
-rw-r--r--ld/testsuite/ld-pdp11/nmagic.d11
-rw-r--r--ld/testsuite/ld-pdp11/omagic.d12
-rw-r--r--ld/testsuite/ld-pdp11/pdp11.exp33
-rw-r--r--ld/testsuite/ld-pdp11/sections.s13
6 files changed, 93 insertions, 0 deletions
diff --git a/ld/testsuite/ld-pdp11/imagic.d b/ld/testsuite/ld-pdp11/imagic.d
new file mode 100644
index 0000000..2e1566c2
--- /dev/null
+++ b/ld/testsuite/ld-pdp11/imagic.d
@@ -0,0 +1,12 @@
+#name: pdp11-aout imagic format
+# nm sort alphabetically since both _start and _data are 0
+#source: sections.s
+#ld: --imagic
+#DUMPPROG: nm
+#...
+0+2 B _bss
+#...
+0+0 D _data
+#...
+0+0 T _start
+#pass
diff --git a/ld/testsuite/ld-pdp11/imagicz.d b/ld/testsuite/ld-pdp11/imagicz.d
new file mode 100644
index 0000000..38a11b4
--- /dev/null
+++ b/ld/testsuite/ld-pdp11/imagicz.d
@@ -0,0 +1,12 @@
+#name: pdp11-aout imagic format -z
+# nm sort alphabetically since both _start and _data are 0
+#source: sections.s
+#ld: -z
+#DUMPPROG: nm
+#...
+0+2 B _bss
+#...
+0+0 D _data
+#...
+0+0 T _start
+#pass
diff --git a/ld/testsuite/ld-pdp11/nmagic.d b/ld/testsuite/ld-pdp11/nmagic.d
new file mode 100644
index 0000000..acdae24
--- /dev/null
+++ b/ld/testsuite/ld-pdp11/nmagic.d
@@ -0,0 +1,11 @@
+#name: pdp11-aout nmagic format
+#source: sections.s
+#ld: --nmagic
+#nm: -n
+#...
+0+0 T _start
+#...
+0*2000 D _data
+#...
+0*2002 B _bss
+#pass
diff --git a/ld/testsuite/ld-pdp11/omagic.d b/ld/testsuite/ld-pdp11/omagic.d
new file mode 100644
index 0000000..ed3a423
--- /dev/null
+++ b/ld/testsuite/ld-pdp11/omagic.d
@@ -0,0 +1,12 @@
+#name: pdp11-aout omagic format
+# also testing that --omagic is the default
+#source: sections.s
+#ld:
+#nm: -n
+#...
+0+0 T _start
+#...
+0+6 D _data
+#...
+0+8 B _bss
+#pass
diff --git a/ld/testsuite/ld-pdp11/pdp11.exp b/ld/testsuite/ld-pdp11/pdp11.exp
new file mode 100644
index 0000000..90c82df
--- /dev/null
+++ b/ld/testsuite/ld-pdp11/pdp11.exp
@@ -0,0 +1,33 @@
+# Expect script for ld-pdp11 tests
+# Copyright (C) 2016-2020 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.
+#
+
+# Test pdp11 linking; at this point just the options for the three
+# a.out format variants.
+
+if ![istarget "pdp11-*-*"] then {
+ return
+}
+
+set pdp11_test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
+foreach pdp11_test $pdp11_test_list {
+ verbose [file rootname $pdp11_test]
+ run_dump_test [file rootname $pdp11_test]
+}
diff --git a/ld/testsuite/ld-pdp11/sections.s b/ld/testsuite/ld-pdp11/sections.s
new file mode 100644
index 0000000..c6e40a0
--- /dev/null
+++ b/ld/testsuite/ld-pdp11/sections.s
@@ -0,0 +1,13 @@
+ .globl _start
+ .text
+_start:
+ mov _data,_bss
+ .globl _data
+ .data
+_data:
+ .word 1
+ .globl _bss
+ .bss
+_bss:
+ .=.+2
+ .end