aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2011-06-29 16:29:38 +0000
committerNick Clifton <nickc@redhat.com>2011-06-29 16:29:38 +0000
commit49c62a3353799da5cdd3d87d35a944026b88fcee (patch)
tree1542e686fb5631a9199146d420fc32d43b647e65 /gas
parent6f5def7d9ee6b0f09cefb41a55c72aff77787cfe (diff)
downloadgdb-49c62a3353799da5cdd3d87d35a944026b88fcee.zip
gdb-49c62a3353799da5cdd3d87d35a944026b88fcee.tar.gz
gdb-49c62a3353799da5cdd3d87d35a944026b88fcee.tar.bz2
PR gas/12931
* config/tc-arm.c (mapping_state): When changing to ARM or THUMB state set the minimum required alignment of the section.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-arm.c19
2 files changed, 24 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index d426507..cea235d 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2011-06-29 Dave Martin <dave.martin@linaro.org>
+
+ PR gas/12931
+ * config/tc-arm.c (mapping_state): When changing to ARM or THUMB
+ state set the minimum required alignment of the section.
+
2011-06-29 Tristan Gingold <gingold@adacore.com>
* config/tc-i386.c (i386_mach): Convert to ISO-C.
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 1d964c3..ae70f69 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -2589,7 +2589,24 @@ mapping_state (enum mstate state)
/* The mapping symbol has already been emitted.
There is nothing else to do. */
return;
- else if (TRANSITION (MAP_UNDEFINED, MAP_DATA))
+
+ if (state == MAP_ARM || state == MAP_THUMB)
+ /* PR gas/12931
+ All ARM instructions require 4-byte alignment.
+ (Almost) all Thumb instructions require 2-byte alignment.
+
+ When emitting instructions into any section, mark the section
+ appropriately.
+
+ Some Thumb instructions are alignment-sensitive modulo 4 bytes,
+ but themselves require 2-byte alignment; this applies to some
+ PC- relative forms. However, these cases will invovle implicit
+ literal pool generation or an explicit .align >=2, both of
+ which will cause the section to me marked with sufficient
+ alignment. Thus, we don't handle those cases here. */
+ record_alignment (now_seg, state == MAP_ARM ? 2 : 1);
+
+ if (TRANSITION (MAP_UNDEFINED, MAP_DATA))
/* This case will be evaluated later in the next else. */
return;
else if (TRANSITION (MAP_UNDEFINED, MAP_ARM)