summaryrefslogtreecommitdiff
path: root/lib/MC/MCELFStreamer.cpp
diff options
context:
space:
mode:
authorDavid Meyer <pdox@google.com>2012-02-15 15:09:06 +0000
committerDavid Meyer <pdox@google.com>2012-02-15 15:09:06 +0000
commit5f7692604d44192206fbaf390085a95c9fb1a40b (patch)
tree55d04e26bcd0b4ebaf4fbacd11523f767a8f4bc2 /lib/MC/MCELFStreamer.cpp
parent4a1ff2fb3ecaa2576ecf9ed84816b174c235ac1d (diff)
downloadllvm-5f7692604d44192206fbaf390085a95c9fb1a40b.tar.gz
llvm-5f7692604d44192206fbaf390085a95c9fb1a40b.tar.bz2
llvm-5f7692604d44192206fbaf390085a95c9fb1a40b.tar.xz
For ELF, also call fixSymbolsInTLSFixups() on expressions passed to EmitValue (literal values). Previously only called on expressions in instructions. New test cases added to tls.s, tls-i386.s. Resolves PR11981.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150582 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCELFStreamer.cpp')
-rw-r--r--lib/MC/MCELFStreamer.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/MC/MCELFStreamer.cpp b/lib/MC/MCELFStreamer.cpp
index 607e01cd82..6c4d0e33a1 100644
--- a/lib/MC/MCELFStreamer.cpp
+++ b/lib/MC/MCELFStreamer.cpp
@@ -102,6 +102,8 @@ public:
unsigned MaxBytesToEmit = 0);
virtual void EmitCodeAlignment(unsigned ByteAlignment,
unsigned MaxBytesToEmit = 0);
+ virtual void EmitValueImpl(const MCExpr *Value, unsigned Size,
+ unsigned AddrSpace);
virtual void EmitFileDirective(StringRef Filename);
@@ -387,6 +389,13 @@ void MCELFStreamer::EmitCodeAlignment(unsigned ByteAlignment,
getCurrentSectionData()->setAlignment(ByteAlignment);
}
+void MCELFStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size,
+ unsigned AddrSpace) {
+ fixSymbolsInTLSFixups(Value);
+ MCObjectStreamer::EmitValueImpl(Value, Size, AddrSpace);
+}
+
+
// Add a symbol for the file name of this module. This is the second
// entry in the module's symbol table (the first being the null symbol).
void MCELFStreamer::EmitFileDirective(StringRef Filename) {