]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR27101, as: Reject (byte) .align 0x100000000
authorAlan Modra <amodra@gmail.com>
Sun, 3 Jan 2021 22:23:37 +0000 (08:53 +1030)
committerAlan Modra <amodra@gmail.com>
Mon, 4 Jan 2021 00:38:05 +0000 (11:08 +1030)
This allows alignments up to 2**TC_ALIGN_LIMIT, which might be larger
than an unsigned int can hold.

PR 27101
* read.c (s_align): Use a large enough type for "align" to hold
the result of get_absolute_expression.

gas/ChangeLog
gas/read.c

index 155ec7e3b16ecbe9883ac4eb95228a9bb7a5c553..b38c379a21596ab43fdeb9727349b3cda612fd01 100644 (file)
@@ -1,3 +1,9 @@
+2021-01-04  Alan Modra  <amodra@gmail.com>
+
+       PR 27101
+       * read.c (s_align): Use a large enough type for "align" to hold
+       the result of get_absolute_expression.
+
 2021-01-01  Nicolas Boulenguez  <nicolas@debian.org>
 
        * config/tc-i386.c: Correct comment spelling.
index cf704b31ca3f63e599756ce9bbd7685860ebb7e5..9d0ba27ea8c75ca21fdc0a151663ab36d3551a7f 100644 (file)
@@ -1548,7 +1548,7 @@ static void
 s_align (signed int arg, int bytes_p)
 {
   unsigned int align_limit = TC_ALIGN_LIMIT;
-  unsigned int align;
+  addressT align;
   char *stop = NULL;
   char stopc = 0;
   offsetT fill = 0;
@@ -1595,7 +1595,7 @@ s_align (signed int arg, int bytes_p)
   if (align > align_limit)
     {
       align = align_limit;
-      as_warn (_("alignment too large: %u assumed"), align);
+      as_warn (_("alignment too large: %u assumed"), align_limit);
     }
 
   if (*input_line_pointer != ',')