diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-02-07 08:26:40 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-02-07 08:26:40 +0000 |
commit | 5614ea9aae25fc763d184ee4b940eac27f5ec3a7 (patch) | |
tree | 7cf8614df3f529e145578c12614956b264041a63 /llvm/lib/MC/MCSectionCOFF.cpp | |
parent | c94234c11cce3e6ff99b77d2505e9a9cb4ef0c98 (diff) | |
download | llvm-5614ea9aae25fc763d184ee4b940eac27f5ec3a7.zip llvm-5614ea9aae25fc763d184ee4b940eac27f5ec3a7.tar.gz llvm-5614ea9aae25fc763d184ee4b940eac27f5ec3a7.tar.bz2 |
MC: Emit COFF section flags in the "proper" order
COFF section flags are not idempotent:
'rd' will make a read-write section because 'd' implies write
'dr' will make a read-only section because 'r' disables write
llvm-svn: 228490
Diffstat (limited to 'llvm/lib/MC/MCSectionCOFF.cpp')
-rw-r--r-- | llvm/lib/MC/MCSectionCOFF.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/MC/MCSectionCOFF.cpp b/llvm/lib/MC/MCSectionCOFF.cpp index e95845f..4d6298c 100644 --- a/llvm/lib/MC/MCSectionCOFF.cpp +++ b/llvm/lib/MC/MCSectionCOFF.cpp @@ -47,6 +47,10 @@ void MCSectionCOFF::PrintSwitchToSection(const MCAsmInfo &MAI, } OS << "\t.section\t" << getSectionName() << ",\""; + if (getCharacteristics() & COFF::IMAGE_SCN_CNT_INITIALIZED_DATA) + OS << 'd'; + if (getCharacteristics() & COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA) + OS << 'b'; if (getCharacteristics() & COFF::IMAGE_SCN_MEM_EXECUTE) OS << 'x'; if (getCharacteristics() & COFF::IMAGE_SCN_MEM_WRITE) @@ -55,10 +59,6 @@ void MCSectionCOFF::PrintSwitchToSection(const MCAsmInfo &MAI, OS << 'r'; else OS << 'y'; - if (getCharacteristics() & COFF::IMAGE_SCN_CNT_INITIALIZED_DATA) - OS << 'd'; - if (getCharacteristics() & COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA) - OS << 'b'; if (getCharacteristics() & COFF::IMAGE_SCN_LNK_REMOVE) OS << 'n'; if (getCharacteristics() & COFF::IMAGE_SCN_MEM_SHARED) |