[llvm-bugs] [Bug 25837] New: Absent alignment field in .comm differs from GAS

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Dec 15 14:19:19 PST 2015


https://llvm.org/bugs/show_bug.cgi?id=25837

            Bug ID: 25837
           Summary: Absent alignment field in .comm differs from GAS
           Product: libraries
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: MC
          Assignee: unassignedbugs at nondot.org
          Reporter: dan433584 at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

The interpretation of an absent alignment field in .comm (and .lcomm)
directives in llvm-mc differs from GAS:

$ cat comm.s
.comm foo,256
$ as comm.s -o comm.o
$ readelf -sW comm.o |grep foo
     4: 0000000000000010   256 OBJECT  GLOBAL DEFAULT  COM foo
$ llvm-mc -filetype=obj -o comm.o comm.s
$ readelf -sW comm.o |grep foo
     1: 0000000000000001   256 OBJECT  GLOBAL DEFAULT  COM foo

Note that for COMMON symbols, the Value field holds the alignment, so it's 16
for GAS here and 1 for llvm-mc.

The GAS behavior is documented on this page:

https://sourceware.org/binutils/docs/as/Comm.html#Comm

"If no alignment is specified, as will set the alignment to the largest power
of two less than or equal to the size of the symbol, up to a maximum of 16 on
ELF, or the default section alignment of 4 on PE."

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20151215/048cae3a/attachment-0001.html>


More information about the llvm-bugs mailing list