From 7ae2971b7af507f3d30ff3c0877bb9448e1eb683 Mon Sep 17 00:00:00 2001 From: Paul Brook Date: Fri, 7 Apr 2006 15:08:04 +0000 Subject: [PATCH] 2006-04-07 Paul Brook 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. --- gas/ChangeLog | 4 ++++ gas/config/tc-arm.c | 8 ++++++++ gas/testsuite/ChangeLog | 5 +++++ gas/testsuite/gas/arm/blx-local.d | 14 ++++++++++++++ gas/testsuite/gas/arm/blx-local.s | 16 ++++++++++++++++ 5 files changed, 47 insertions(+) create mode 100644 gas/testsuite/gas/arm/blx-local.d create mode 100644 gas/testsuite/gas/arm/blx-local.s diff --git a/gas/ChangeLog b/gas/ChangeLog index 84cee21a71c..7e7b0df4dbc 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,7 @@ +2006-04-07 Paul Brook + + * config/tc-arm.c (md_apply_fix): Set H bit on blx instruction. + 2006-04-07 Paul Brook * config/tc-arm.c (THUMB2_LOAD_BIT): Define. diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index bf91b89e647..54cd349d59d 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 6a569df8562..0172771a3de 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-04-07 Paul Brook + + * gas/arm/blx-local.d: New test. + * gas/arm/blx-local.d: New test. + 2006-04-07 Paul Brook * gas/arm/thumb2_pool.d: 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 00000000000..5c868ff0939 --- /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 +0+04 <[^>]*> fbffffff blx 00+a +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 00000000000..c85a562d90f --- /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 -- 2.30.2