summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCELFStreamer.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-10-16 01:05:45 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-10-16 01:05:45 +0000
commit5645bade1bcde40a768b7daa43d8e0878243aae1 (patch)
treea6d5eac3733cdb125baa15eb3c36c9ce07c8e8f8 /llvm/lib/MC/MCELFStreamer.cpp
parentb01a3bec88f240b4e2b39424f6aa78c6bd7b8f8a (diff)
downloadbcm5719-llvm-5645bade1bcde40a768b7daa43d8e0878243aae1.tar.gz
bcm5719-llvm-5645bade1bcde40a768b7daa43d8e0878243aae1.zip
Move .ident handling to MCStreamer.
No functionality change, but exposes the API so that codegen can use it too. Patch by Katya Romanova. llvm-svn: 192757
Diffstat (limited to 'llvm/lib/MC/MCELFStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCELFStreamer.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCELFStreamer.cpp b/llvm/lib/MC/MCELFStreamer.cpp
index c16a61d2b69..3f6c62c0625 100644
--- a/llvm/lib/MC/MCELFStreamer.cpp
+++ b/llvm/lib/MC/MCELFStreamer.cpp
@@ -329,7 +329,22 @@ void MCELFStreamer::EmitFileDirective(StringRef Filename) {
SD.setFlags(ELF_STT_File | ELF_STB_Local | ELF_STV_Default);
}
-void MCELFStreamer::fixSymbolsInTLSFixups(const MCExpr *expr) {
+void MCELFStreamer::EmitIdent(StringRef IdentString) {
+ const MCSection *Comment = getAssembler().getContext().getELFSection(
+ ".comment", ELF::SHT_PROGBITS, ELF::SHF_MERGE | ELF::SHF_STRINGS,
+ SectionKind::getReadOnly(), 1, "");
+ PushSection();
+ SwitchSection(Comment);
+ if (!SeenIdent) {
+ EmitIntValue(0, 1);
+ SeenIdent = true;
+ }
+ EmitBytes(IdentString);
+ EmitIntValue(0, 1);
+ PopSection();
+}
+
+void MCELFStreamer::fixSymbolsInTLSFixups(const MCExpr *expr) {
switch (expr->getKind()) {
case MCExpr::Target:
cast<MCTargetExpr>(expr)->fixELFSymbolsInTLSFixups(getAssembler());
OpenPOWER on IntegriCloud