diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-11-11 18:13:52 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-11-11 18:13:52 +0000 |
commit | 2ff9e83a826c1c2ee0f1c6072d3d97d5b10678ee (patch) | |
tree | 7b0da82eca52b236bf7259f9d451dde58a1f7689 /lib/MC/MCParser/ELFAsmParser.cpp | |
parent | 56653f0df85f8e4ee60941a6ca31c17ca6f936ff (diff) |
Initial comdat implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118805 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCParser/ELFAsmParser.cpp')
-rw-r--r-- | lib/MC/MCParser/ELFAsmParser.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/MC/MCParser/ELFAsmParser.cpp b/lib/MC/MCParser/ELFAsmParser.cpp index 75eee3d442..278f146ad6 100644 --- a/lib/MC/MCParser/ELFAsmParser.cpp +++ b/lib/MC/MCParser/ELFAsmParser.cpp @@ -203,6 +203,7 @@ bool ELFAsmParser::ParseDirectiveSection(StringRef, SMLoc) { StringRef FlagsStr; StringRef TypeName; int64_t Size = 0; + StringRef GroupName; if (getLexer().is(AsmToken::Comma)) { Lex(); @@ -249,7 +250,6 @@ bool ELFAsmParser::ParseDirectiveSection(StringRef, SMLoc) { if (getLexer().isNot(AsmToken::Comma)) return TokError("expected group name"); Lex(); - StringRef GroupName; if (getParser().ParseIdentifier(GroupName)) return true; if (getLexer().is(AsmToken::Comma)) { @@ -257,8 +257,8 @@ bool ELFAsmParser::ParseDirectiveSection(StringRef, SMLoc) { StringRef Linkage; if (getParser().ParseIdentifier(Linkage)) return true; - if (Linkage != "comdat" && Linkage != ".gnu.linkonce") - return TokError("Linkage must be 'comdat' or '.gnu.linkonce'"); + if (Linkage != "comdat") + return TokError("Linkage must be 'comdat'"); } } } @@ -306,6 +306,7 @@ bool ELFAsmParser::ParseDirectiveSection(StringRef, SMLoc) { Flags |= MCSectionELF::XCORE_SHF_DP_SECTION; break; case 'G': + Flags |= MCSectionELF::SHF_GROUP; break; default: return TokError("unknown flag"); @@ -331,7 +332,8 @@ bool ELFAsmParser::ParseDirectiveSection(StringRef, SMLoc) { ? SectionKind::getText() : SectionKind::getDataRel(); getStreamer().SwitchSection(getContext().getELFSection(SectionName, Type, - Flags, Kind, Size)); + Flags, Kind, Size, + GroupName)); return false; } @@ -405,7 +407,7 @@ bool ELFAsmParser::ParseDirectiveIdent(StringRef, SMLoc) { MCSectionELF::SHF_MERGE | MCSectionELF::SHF_STRINGS, SectionKind::getReadOnly(), - 1); + 1, ""); static bool First = true; |