aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2016-05-11 12:51:04 +0100
committerNick Clifton <nickc@redhat.com>2016-05-11 12:53:12 +0100
commita6684f0dddb292873f962dc36b20e6db00ef6b09 (patch)
tree907b253ccc181c667eeed048f3f7650463fc0984 /gas
parent4e7fbb34f0546360e86b56dcd32b4d6478662b41 (diff)
downloadgdb-a6684f0dddb292873f962dc36b20e6db00ef6b09.zip
gdb-a6684f0dddb292873f962dc36b20e6db00ef6b09.tar.gz
gdb-a6684f0dddb292873f962dc36b20e6db00ef6b09.tar.bz2
Ensure that padding in the constant pool uses constant values.
PR target/20068 * config/tc-arm.c (add_to_lit_pool): Ensure that the padding added to the pool uses O_constant. * testsuite/gas/arm/pr20068.s: New test. * testsuite/gas/arm/pr20068.d: Test driver.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog8
-rw-r--r--gas/config/tc-arm.c1
-rw-r--r--gas/testsuite/gas/arm/pr20068.d18
-rw-r--r--gas/testsuite/gas/arm/pr20068.s10
4 files changed, 37 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index cf46ef9..6a059e7 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,13 @@
2016-05-11 Nick Clifton <nickc@redhat.com>
+ PR target/20068
+ * config/tc-arm.c (add_to_lit_pool): Ensure that the padding added
+ to the pool uses O_constant.
+ * testsuite/gas/arm/pr20068.s: New test.
+ * testsuite/gas/arm/pr20068.d: Test driver.
+
+2016-05-11 Nick Clifton <nickc@redhat.com>
+
* testsuite/gas/arm/archv8m-cmse-base.d: Skip for non-ELF ARM targets.
* testsuite/gas/arm/archv8m-cmse-main-1.d: Likewise.
* testsuite/gas/arm/archv8m-cmse-main-2.d: Likewise.
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index b5f3786..3c7e014 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -3288,6 +3288,7 @@ add_to_lit_pool (unsigned int nbytes)
}
pool->literals[entry] = inst.reloc.exp;
+ pool->literals[entry].X_op = O_constant;
pool->literals[entry].X_add_number = 0;
pool->literals[entry++].X_md = (PADDING_SLOT << 8) | 4;
pool->next_free_entry += 1;
diff --git a/gas/testsuite/gas/arm/pr20068.d b/gas/testsuite/gas/arm/pr20068.d
new file mode 100644
index 0000000..b694c0e
--- /dev/null
+++ b/gas/testsuite/gas/arm/pr20068.d
@@ -0,0 +1,18 @@
+# name: PR20068 - Misaligned constant pool when running GAS on a 32-bit host.
+# as: -mfpu=vfpv3
+# objdump: -S
+
+.*: file format .*
+
+
+Disassembly of section .text:
+
+00000000 <main>:
+ 0: e59f0008 ldr r0, \[pc, #8\].*
+ 4: ed9f9b03 vldr d9, \[pc, #12\].*
+ 8: e1a0f00e mov pc, lr
+ c: 00000000 .*
+ 10: 12345678 .*
+ 14: 00000000 .*
+ 18: 00000fff .*
+ 1c: 0000fff0 .*
diff --git a/gas/testsuite/gas/arm/pr20068.s b/gas/testsuite/gas/arm/pr20068.s
new file mode 100644
index 0000000..483cc2e
--- /dev/null
+++ b/gas/testsuite/gas/arm/pr20068.s
@@ -0,0 +1,10 @@
+.global main
+
+main:
+LDR R0, =0x12345678
+@LDR R0, =0x87654321
+FLDD D9, =0xfff000000fff
+@FLDD D9, =0
+@FLDD D9, =0x0
+MOV PC, LR
+.ltorg