aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2006-04-07 15:08:04 +0000
committerPaul Brook <paul@codesourcery.com>2006-04-07 15:08:04 +0000
commit7ae2971b7af507f3d30ff3c0877bb9448e1eb683 (patch)
tree8871dc050002ecd7bd966448c4a4a8889ffe9577
parent53365c0d765c72dcca8ca57f4c8dd8bb2e0c1b19 (diff)
downloadgdb-7ae2971b7af507f3d30ff3c0877bb9448e1eb683.zip
gdb-7ae2971b7af507f3d30ff3c0877bb9448e1eb683.tar.gz
gdb-7ae2971b7af507f3d30ff3c0877bb9448e1eb683.tar.bz2
2006-04-07 Paul Brook <paul@codesourcery.com>
gas/ * config/tc-arm.c (md_apply_fix): Set H bit on blx instruction. gas/testsuite/ * gas/arm/blx-local.d: New test. * gas/arm/blx-local.d: New test.
-rw-r--r--gas/ChangeLog4
-rw-r--r--gas/config/tc-arm.c8
-rw-r--r--gas/testsuite/ChangeLog5
-rw-r--r--gas/testsuite/gas/arm/blx-local.d14
-rw-r--r--gas/testsuite/gas/arm/blx-local.s16
5 files changed, 47 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 84cee21..7e7b0df 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,9 @@
2006-04-07 Paul Brook <paul@codesourcery.com>
+ * config/tc-arm.c (md_apply_fix): Set H bit on blx instruction.
+
+2006-04-07 Paul Brook <paul@codesourcery.com>
+
* 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.
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index bf91b89..54cd349 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -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/ChangeLog b/gas/testsuite/ChangeLog
index 6a569df..0172771 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2006-04-07 Paul Brook <paul@codesourcery.com>
+ * gas/arm/blx-local.d: New test.
+ * gas/arm/blx-local.d: New test.
+
+2006-04-07 Paul Brook <paul@codesourcery.com>
+
* gas/arm/thumb2_pool.d: New test.
* gas/arm/thumb2_pool.s: New test.
diff --git a/gas/testsuite/gas/arm/blx-local.d b/gas/testsuite/gas/arm/blx-local.d
new file mode 100644
index 0000000..5c868ff
--- /dev/null
+++ b/gas/testsuite/gas/arm/blx-local.d
@@ -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
index 0000000..c85a562
--- /dev/null
+++ b/gas/testsuite/gas/arm/blx-local.s
@@ -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