This commit was manufactured by cvs2svn to create branch 'binutils-csl-
authornobody <>
Wed, 16 Aug 2006 10:32:41 +0000 (10:32 +0000)
committernobody <>
Wed, 16 Aug 2006 10:32:41 +0000 (10:32 +0000)
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

gas/testsuite/gas/arm/noarm.d [new file with mode: 0644]
gas/testsuite/gas/arm/noarm.l [new file with mode: 0644]
gas/testsuite/gas/arm/noarm.s [new file with mode: 0644]
ld/emultempl/mipself.em [new file with mode: 0644]
ld/testsuite/ld-mips-elf/hash1.s [new file with mode: 0644]
ld/testsuite/ld-mips-elf/hash1a.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/hash1b.d [new file with mode: 0644]
ld/testsuite/ld-mips-elf/hash1c.d [new file with mode: 0644]

diff --git a/gas/testsuite/gas/arm/noarm.d b/gas/testsuite/gas/arm/noarm.d
new file mode 100644 (file)
index 0000000..ae34f83
--- /dev/null
@@ -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 (file)
index 0000000..edc59a2
--- /dev/null
@@ -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 (file)
index 0000000..3dadd44
--- /dev/null
@@ -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 (file)
index 0000000..846cdc5
--- /dev/null
@@ -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 (file)
index 0000000..4e7fe2f
--- /dev/null
@@ -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 (file)
index 0000000..f3adaa8
--- /dev/null
@@ -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 (file)
index 0000000..5af9037
--- /dev/null
@@ -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 (file)
index 0000000..09bff3c
--- /dev/null
@@ -0,0 +1,3 @@
+#source: hash1.s
+#ld: -shared --hash-style=gnu
+#error: .gnu.hash is incompatible with the MIPS ABI