summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobody <>2006-08-16 10:32:41 +0000
committernobody <>2006-08-16 10:32:41 +0000
commitc703036b9258a5404ebf81235b9629f53b2f75cb (patch)
tree77c0988f3aa64b4afb36697f0a08d8792cb54039
parent974b54fdb635a6c913935aaf3ae9239eaee53b72 (diff)
downloadbinutils-gdb-c703036b9258a5404ebf81235b9629f53b2f75cb.tar.gz
This commit was manufactured by cvs2svn to create branch 'binutils-csl-
2_17-branch'. Cherrypick from master 2006-08-16 10:32:40 UTC Julian Brown <julian@codesourcery.com> ' * gas/arm/noarm.s: Add test for disabled ARM insns.': gas/testsuite/gas/arm/noarm.d gas/testsuite/gas/arm/noarm.l gas/testsuite/gas/arm/noarm.s ld/emultempl/mipself.em ld/testsuite/ld-mips-elf/hash1.s ld/testsuite/ld-mips-elf/hash1a.d ld/testsuite/ld-mips-elf/hash1b.d ld/testsuite/ld-mips-elf/hash1c.d
-rw-r--r--gas/testsuite/gas/arm/noarm.d3
-rw-r--r--gas/testsuite/gas/arm/noarm.l3
-rw-r--r--gas/testsuite/gas/arm/noarm.s13
-rw-r--r--ld/emultempl/mipself.em37
-rw-r--r--ld/testsuite/ld-mips-elf/hash1.s1
-rw-r--r--ld/testsuite/ld-mips-elf/hash1a.d4
-rw-r--r--ld/testsuite/ld-mips-elf/hash1b.d3
-rw-r--r--ld/testsuite/ld-mips-elf/hash1c.d3
8 files changed, 67 insertions, 0 deletions
diff --git a/gas/testsuite/gas/arm/noarm.d b/gas/testsuite/gas/arm/noarm.d
new file mode 100644
index 00000000000..ae34f8342f9
--- /dev/null
+++ b/gas/testsuite/gas/arm/noarm.d
@@ -0,0 +1,3 @@
+# name: Disallow ARM instructions on V7M
+# as:
+# error-output: noarm.l
diff --git a/gas/testsuite/gas/arm/noarm.l b/gas/testsuite/gas/arm/noarm.l
new file mode 100644
index 00000000000..edc59a2d537
--- /dev/null
+++ b/gas/testsuite/gas/arm/noarm.l
@@ -0,0 +1,3 @@
+[^:]*: Assembler messages:
+[^:]*:12: Error: selected processor does not support ARM opcodes
+[^:]*:13: Error: attempt to use an ARM instruction on a Thumb-only processor -- `nop'
diff --git a/gas/testsuite/gas/arm/noarm.s b/gas/testsuite/gas/arm/noarm.s
new file mode 100644
index 00000000000..3dadd4468f1
--- /dev/null
+++ b/gas/testsuite/gas/arm/noarm.s
@@ -0,0 +1,13 @@
+ .arch armv7a
+ .syntax unified
+ .text
+func:
+ nop
+ movw r0, #0
+
+ .arch armv7
+ .thumb
+ nop
+ movw r0, #0
+ .arm
+ nop
diff --git a/ld/emultempl/mipself.em b/ld/emultempl/mipself.em
new file mode 100644
index 00000000000..846cdc51dbb
--- /dev/null
+++ b/ld/emultempl/mipself.em
@@ -0,0 +1,37 @@
+# This shell script emits a C file. -*- C -*-
+# Copyright 2006 Free Software Foundation, Inc.
+#
+# This file is part of GLD, the Gnu Linker.
+#
+# 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 2 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.
+
+cat >>e${EMULATION_NAME}.c <<EOF
+static void
+mips_after_parse (void)
+{
+ /* .gnu.hash and the MIPS ABI require .dynsym to be sorted in different
+ ways. .gnu.hash needs symbols to be grouped by hash code whereas the
+ MIPS ABI requires a mapping between the GOT and the symbol table. */
+ if (link_info.emit_gnu_hash)
+ {
+ einfo ("%X%P: .gnu.hash is incompatible with the MIPS ABI\n");
+ link_info.emit_hash = TRUE;
+ link_info.emit_gnu_hash = FALSE;
+ }
+ after_parse_default ();
+}
+EOF
+
+LDEMUL_AFTER_PARSE=mips_after_parse
diff --git a/ld/testsuite/ld-mips-elf/hash1.s b/ld/testsuite/ld-mips-elf/hash1.s
new file mode 100644
index 00000000000..4e7fe2f0a49
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/hash1.s
@@ -0,0 +1 @@
+ nop
diff --git a/ld/testsuite/ld-mips-elf/hash1a.d b/ld/testsuite/ld-mips-elf/hash1a.d
new file mode 100644
index 00000000000..f3adaa8d5e7
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/hash1a.d
@@ -0,0 +1,4 @@
+#source: hash1.s
+#ld: -shared --hash-style=sysv
+#objdump: -dr
+#pass
diff --git a/ld/testsuite/ld-mips-elf/hash1b.d b/ld/testsuite/ld-mips-elf/hash1b.d
new file mode 100644
index 00000000000..5af9037cfc3
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/hash1b.d
@@ -0,0 +1,3 @@
+#source: hash1.s
+#ld: -shared --hash-style=both
+#error: .gnu.hash is incompatible with the MIPS ABI
diff --git a/ld/testsuite/ld-mips-elf/hash1c.d b/ld/testsuite/ld-mips-elf/hash1c.d
new file mode 100644
index 00000000000..09bff3cad96
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/hash1c.d
@@ -0,0 +1,3 @@
+#source: hash1.s
+#ld: -shared --hash-style=gnu
+#error: .gnu.hash is incompatible with the MIPS ABI