aboutsummaryrefslogtreecommitdiffstats
path: root/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
commitc7ce3e4f42219003f30382be17d966cb2dfb4e71 (patch)
tree682db2c5d6612be584c612b334e7f54af0b2094f /lib/MC/MCELFStreamer.cpp
parente5fdae03a4137267ae124a35aef11f72bb6aa13b (diff)
downloadexternal_llvm-c7ce3e4f42219003f30382be17d966cb2dfb4e71.zip
external_llvm-c7ce3e4f42219003f30382be17d966cb2dfb4e71.tar.gz
external_llvm-c7ce3e4f42219003f30382be17d966cb2dfb4e71.tar.bz2
Move .ident handling to MCStreamer.
No functionality change, but exposes the API so that codegen can use it too. Patch by Katya Romanova. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192757 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCELFStreamer.cpp')
-rw-r--r--lib/MC/MCELFStreamer.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/MC/MCELFStreamer.cpp b/lib/MC/MCELFStreamer.cpp
index c16a61d..3f6c62c 100644
--- a/lib/MC/MCELFStreamer.cpp
+++ b/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());