2006-03-20 Paul Brook <paul@codesourcery.com>
authorPaul Brook <paul@codesourcery.com>
Mon, 20 Mar 2006 20:53:13 +0000 (20:53 +0000)
committerPaul Brook <paul@codesourcery.com>
Mon, 20 Mar 2006 20:53:13 +0000 (20:53 +0000)
* gas/config/tc-arm.c (md_apply_fix): Set H bit on blx instruction.

* gas/testsuite/gas/arm/blx-local.d: New test.
* gas/testsuite/gas/arm/blx-local.d: New test.

ChangeLog.csl
gas/config/tc-arm.c
gas/testsuite/gas/arm/blx-local.d [new file with mode: 0644]
gas/testsuite/gas/arm/blx-local.s [new file with mode: 0644]
gas/testsuite/gas/arm/thumb2_pool.d [new file with mode: 0644]
gas/testsuite/gas/arm/thumb2_pool.s [new file with mode: 0644]

index 5e7f739..11e352f 100644 (file)
@@ -1,9 +1,15 @@
 2006-03-20  Paul Brook  <paul@codesourcery.com>
 
-gas/
-       * config/tc-arm.c (THUMB2_LOAD_BIT): Define.
+       * gas/config/tc-arm.c (md_apply_fix): Set H bit on blx instruction.
+
+       * gas/testsuite/gas/arm/blx-local.d: New test.
+       * gas/testsuite/gas/arm/blx-local.d: New test.
+
+2006-03-20  Paul Brook  <paul@codesourcery.com>
+
+       * gas/config/tc-arm.c (THUMB2_LOAD_BIT): Define.
        (move_or_literal_pool): Handle Thumb-2 instructions.
        (do_t_ldst): Call move_or_literal_pool for =N addressing modes.
-gas/testsuite/
-       * gas/arm/thumb2_pool.d: New test.
-       * gas/arm/thumb2_pool.s: New test.
+
+       * gas/testsuite/gas/arm/thumb2_pool.d: New test.
+       * gas/testsuite/gas/arm/thumb2_pool.s: New test.
index 4e94b30..4305b0b 100644 (file)
@@ -11927,6 +11927,14 @@ md_apply_fix (fixS *   fixP,
        {
          newval = md_chars_to_number (buf, INSN_SIZE);
          newval |= (value >> 2) & 0x00ffffff;
+         /* Set the H bit on BLX instructions.  */
+         if (temp == 1)
+           {
+             if (value & 2)
+               newval |= 0x01000000;
+             else
+               newval &= ~0x01000000;
+           }
          md_number_to_chars (buf, newval, INSN_SIZE);
        }
       break;
diff --git a/gas/testsuite/gas/arm/blx-local.d b/gas/testsuite/gas/arm/blx-local.d
new file mode 100644 (file)
index 0000000..5c868ff
--- /dev/null
@@ -0,0 +1,14 @@
+#name: Local BLX instructions
+#objdump: -dr --prefix-addresses --show-raw-insn
+#as:
+
+# Test assembler resolution of blx instructions.
+
+.*: +file format .*arm.*
+
+Disassembly of section .text:
+
+0+00 <[^>]*> fa000000  blx     00+8 <foo>
+0+04 <[^>]*> fbffffff  blx     00+a <foo2>
+0+08 <[^>]*> 46c0              nop                     \(mov r8, r8\)
+0+0a <[^>]*> 46c0              nop                     \(mov r8, r8\)
diff --git a/gas/testsuite/gas/arm/blx-local.s b/gas/testsuite/gas/arm/blx-local.s
new file mode 100644 (file)
index 0000000..c85a562
--- /dev/null
@@ -0,0 +1,16 @@
+        .text
+       .arch armv5t
+        .arm
+one:
+        blx     foo
+        blx     foo2
+
+        .thumb
+        .type foo, %function
+        .thumb_func
+foo:
+        nop
+        .type foo2, %function
+        .thumb_func
+foo2:
+        nop
diff --git a/gas/testsuite/gas/arm/thumb2_pool.d b/gas/testsuite/gas/arm/thumb2_pool.d
new file mode 100644 (file)
index 0000000..7bf0c60
--- /dev/null
@@ -0,0 +1,15 @@
+# as: -march=armv6t2
+# objdump: -dr --prefix-addresses --show-raw-insn
+
+.*: +file format .*arm.*
+
+Disassembly of section .text:
+0+000 <[^>]+> 4e04             ldr     r6, \[pc, #16\] \(00+14 <[^>]+>\)
+0+002 <[^>]+> 4904             ldr     r1, \[pc, #16\] \(00+14 <[^>]+>\)
+0+004 <[^>]+> f8df 600c        ldr\.w  r6, \[pc, #12\] ; 00+14 <[^>]+>
+0+008 <[^>]+> f8df 9008        ldr\.w  r9, \[pc, #8\]  ; 00+14 <[^>]+>
+0+00c <[^>]+> bf00             nop
+0+00e <[^>]+> f8df 5004        ldr\.w  r5, \[pc, #4\]  ; 00+14 <[^>]+>
+0+012 <[^>]+> 4900             ldr     r1, \[pc, #0\]  \(00+14 <[^>]+>\)
+0+014 <[^>]+> (5678|1234) .*
+0+016 <[^>]+> (1234|5678) .*
diff --git a/gas/testsuite/gas/arm/thumb2_pool.s b/gas/testsuite/gas/arm/thumb2_pool.s
new file mode 100644 (file)
index 0000000..844e77e
--- /dev/null
@@ -0,0 +1,13 @@
+       .text
+       .thumb
+       .syntax unified
+       .thumb_func
+thumb2_ldr:
+       ldr     r6, =0x12345678
+       ldr.n   r1, =0x12345678
+       ldr.w   r6, =0x12345678
+       ldr     r9, =0x12345678
+       nop
+       ldr.w   r5, =0x12345678
+       ldr     r1, =0x12345678
+       .pool