Bug 27101 - as: Reject (byte) .align 0x100000000
Summary: as: Reject (byte) .align 0x100000000
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: 2.36
Assignee: Alan Modra
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-20 22:20 UTC by Fangrui Song
Modified: 2021-01-04 00:42 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed: 2021-01-03 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fangrui Song 2020-12-20 22:20:33 UTC
On targets .align means the byte alignment,

.align 0x1000000000
.balign 0x1000000000
nop

GNU as assembles the code but uses alignment misleading 1. While ELF64_Shdr uses 64-bit sh_addralign, it is fair to reject such a large alignment for the assembler.
Comment 1 Sourceware Commits 2021-01-04 00:41:23 UTC
The master branch has been updated by Alan Modra <amodra@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=90320e40958020aea265dc693d0613a330e40b61

commit 90320e40958020aea265dc693d0613a330e40b61
Author: Alan Modra <amodra@gmail.com>
Date:   Mon Jan 4 08:53:37 2021 +1030

    PR27101, as: Reject (byte) .align 0x100000000
    
    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.
Comment 2 Alan Modra 2021-01-04 00:42:07 UTC
Fixed for 2.36