diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-01-26 20:21:43 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-01-26 20:21:43 +0000 |
| commit | 8fd77a1841661ee1254e50baf3afb58cb0a395b7 (patch) | |
| tree | 8bde9acbfe36cb0089d7e16f7e6349f510b1feb9 /lib | |
| parent | 1fd0182a85e201f0b92773d9edaae8869fa190df (diff) | |
| download | external_llvm-8fd77a1841661ee1254e50baf3afb58cb0a395b7.zip external_llvm-8fd77a1841661ee1254e50baf3afb58cb0a395b7.tar.gz external_llvm-8fd77a1841661ee1254e50baf3afb58cb0a395b7.tar.bz2 | |
Emit .comm alignment in bytes but .align in powers of 2 for ARM ELF.
Original patch by Sandeep Patel and updated by me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94582 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/MC/MCAsmInfo.cpp | 1 | ||||
| -rw-r--r-- | lib/MC/MCAsmInfoCOFF.cpp | 2 | ||||
| -rw-r--r-- | lib/MC/MCAsmInfoDarwin.cpp | 1 | ||||
| -rw-r--r-- | lib/MC/MCAsmStreamer.cpp | 2 | ||||
| -rw-r--r-- | lib/Target/ARM/ARMMCAsmInfo.cpp | 3 |
5 files changed, 7 insertions, 2 deletions
diff --git a/lib/MC/MCAsmInfo.cpp b/lib/MC/MCAsmInfo.cpp index 4a86e1d..12d2fcb 100644 --- a/lib/MC/MCAsmInfo.cpp +++ b/lib/MC/MCAsmInfo.cpp @@ -51,6 +51,7 @@ MCAsmInfo::MCAsmInfo() { GlobalDirective = "\t.globl\t"; SetDirective = 0; HasLCOMMDirective = false; + COMMDirectiveAlignmentIsInBytes = true; HasDotTypeDotSizeDirective = true; HasSingleParameterDotFile = true; HasNoDeadStrip = false; diff --git a/lib/MC/MCAsmInfoCOFF.cpp b/lib/MC/MCAsmInfoCOFF.cpp index e6b79dd..ab8a585 100644 --- a/lib/MC/MCAsmInfoCOFF.cpp +++ b/lib/MC/MCAsmInfoCOFF.cpp @@ -18,6 +18,7 @@ using namespace llvm; MCAsmInfoCOFF::MCAsmInfoCOFF() { GlobalPrefix = "_"; + COMMDirectiveAlignmentIsInBytes = false; HasLCOMMDirective = true; HasDotTypeDotSizeDirective = false; HasSingleParameterDotFile = false; @@ -36,4 +37,3 @@ MCAsmInfoCOFF::MCAsmInfoCOFF() { SupportsDebugInformation = true; DwarfSectionOffsetDirective = "\t.secrel32\t"; } - diff --git a/lib/MC/MCAsmInfoDarwin.cpp b/lib/MC/MCAsmInfoDarwin.cpp index 2cf982f..e84131f 100644 --- a/lib/MC/MCAsmInfoDarwin.cpp +++ b/lib/MC/MCAsmInfoDarwin.cpp @@ -26,6 +26,7 @@ MCAsmInfoDarwin::MCAsmInfoDarwin() { HasSubsectionsViaSymbols = true; AlignmentIsInBytes = false; + COMMDirectiveAlignmentIsInBytes = false; InlineAsmStart = " InlineAsm Start"; InlineAsmEnd = " InlineAsm End"; diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp index d177f95..b544d04 100644 --- a/lib/MC/MCAsmStreamer.cpp +++ b/lib/MC/MCAsmStreamer.cpp @@ -282,7 +282,7 @@ void MCAsmStreamer::EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) { OS << "\t.comm\t" << *Symbol << ',' << Size; if (ByteAlignment != 0) { - if (MAI.getAlignmentIsInBytes()) + if (MAI.getCOMMDirectiveAlignmentIsInBytes()) OS << ',' << ByteAlignment; else OS << ',' << Log2_32(ByteAlignment); diff --git a/lib/Target/ARM/ARMMCAsmInfo.cpp b/lib/Target/ARM/ARMMCAsmInfo.cpp index cc59ec8..911a71f 100644 --- a/lib/Target/ARM/ARMMCAsmInfo.cpp +++ b/lib/Target/ARM/ARMMCAsmInfo.cpp @@ -52,6 +52,9 @@ ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin() { } ARMELFMCAsmInfo::ARMELFMCAsmInfo() { + // ".comm align is in bytes but .align is pow-2." + AlignmentIsInBytes = false; + Data64bitsDirective = 0; CommentString = "@"; |
