aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2015-08-17 09:05:42 +0930
committerAlan Modra <amodra@gmail.com>2015-08-17 09:05:54 +0930
commitdb2ed2e0b910376fd2bf4c2bc5d626315c4269c6 (patch)
tree32b3a8f0135cffb393366209f58905386c69b287 /gas
parent1762568fd6bd84f1b1a488375cf320a1efa06b22 (diff)
downloadgdb-db2ed2e0b910376fd2bf4c2bc5d626315c4269c6.zip
gdb-db2ed2e0b910376fd2bf4c2bc5d626315c4269c6.tar.gz
gdb-db2ed2e0b910376fd2bf4c2bc5d626315c4269c6.tar.bz2
Rationalize ARM .align
* gas/config/tc-arm.c (s_align): Delete. (md_pseudo_table): Use s_align_ptwo for "align". * gas/config/tc-arm.h (TC_ALIGN_ZERO_IS_DEFAULT): Define. * read.c (s_align): Modify for TC_ALIGN_ZERO_IS_DEFAULT.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog7
-rw-r--r--gas/config/tc-arm.c49
-rw-r--r--gas/config/tc-arm.h1
-rw-r--r--gas/read.c5
4 files changed, 14 insertions, 48 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index ecf77fb..4064fc1 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,10 @@
+2015-08-17 Alan Modra <amodra@gmail.com>
+
+ * gas/config/tc-arm.c (s_align): Delete.
+ (md_pseudo_table): Use s_align_ptwo for "align".
+ * gas/config/tc-arm.h (TC_ALIGN_ZERO_IS_DEFAULT): Define.
+ * read.c (s_align): Modify for TC_ALIGN_ZERO_IS_DEFAULT.
+
2015-08-13 Alan Modra <amodra@gmail.com>
* expr.c (operand): Rewrite handling of operands starting with "0f".
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index fabcf80..e54b81b 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -2969,53 +2969,6 @@ s_syntax (int unused ATTRIBUTE_UNUSED)
/* Directives: sectioning and alignment. */
-/* Same as s_align_ptwo but align 0 => align 2. */
-
-static void
-s_align (int unused ATTRIBUTE_UNUSED)
-{
- int temp;
- bfd_boolean fill_p;
- long temp_fill;
- long max_alignment = 15;
-
- temp = get_absolute_expression ();
- if (temp > max_alignment)
- as_bad (_("alignment too large: %d assumed"), temp = max_alignment);
- else if (temp < 0)
- {
- as_bad (_("alignment negative. 0 assumed."));
- temp = 0;
- }
-
- if (*input_line_pointer == ',')
- {
- input_line_pointer++;
- temp_fill = get_absolute_expression ();
- fill_p = TRUE;
- }
- else
- {
- fill_p = FALSE;
- temp_fill = 0;
- }
-
- if (!temp)
- temp = 2;
-
- /* Only make a frag if we HAVE to. */
- if (temp && !need_pass_2)
- {
- if (!fill_p && subseg_text_p (now_seg))
- frag_align_code (temp, 0);
- else
- frag_align (temp, (int) temp_fill, 0);
- }
- demand_empty_rest_of_line ();
-
- record_alignment (now_seg, temp);
-}
-
static void
s_bss (int ignore ATTRIBUTE_UNUSED)
{
@@ -4691,7 +4644,7 @@ const pseudo_typeS md_pseudo_table[] =
{ "qn", s_qn, 0 },
{ "unreq", s_unreq, 0 },
{ "bss", s_bss, 0 },
- { "align", s_align, 0 },
+ { "align", s_align_ptwo, 2 },
{ "arm", s_arm, 0 },
{ "thumb", s_thumb, 0 },
{ "code", s_code, 0 },
diff --git a/gas/config/tc-arm.h b/gas/config/tc-arm.h
index 22e9027..98038be 100644
--- a/gas/config/tc-arm.h
+++ b/gas/config/tc-arm.h
@@ -245,6 +245,7 @@ arm_min (int am_p1, int am_p2)
#define TC_FRAG_TYPE struct arm_frag_type
/* NOTE: max_chars is a local variable from frag_var / frag_variant. */
#define TC_FRAG_INIT(fragp) arm_init_frag (fragp, max_chars)
+#define TC_ALIGN_ZERO_IS_DEFAULT 1
#define HANDLE_ALIGN(fragp) arm_handle_align (fragp)
#define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) \
((!(FRCHAIN)->frch_next && subseg_text_p (SEG)) \
diff --git a/gas/read.c b/gas/read.c
index 816c255..000c75b 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -1471,6 +1471,11 @@ s_align (int arg, int bytes_p)
{
align = get_absolute_expression ();
SKIP_WHITESPACE ();
+
+#ifdef TC_ALIGN_ZERO_IS_DEFAULT
+ if (arg > 0 && align == 0)
+ align = arg;
+#endif
}
if (bytes_p)