diff options
author | David Meyer <pdox@google.com> | 2012-02-15 15:09:06 +0000 |
---|---|---|
committer | David Meyer <pdox@google.com> | 2012-02-15 15:09:06 +0000 |
commit | 44ec69efe0c139020d3c94ed7ec995e687b9ef80 (patch) | |
tree | 970c2ff4aa76c84bcbcbf850b2536e81e21ff76f /llvm/lib/MC/MCELFStreamer.cpp | |
parent | 425e44d1925c02464dbf496e73629b09f295c560 (diff) | |
download | bcm5719-llvm-44ec69efe0c139020d3c94ed7ec995e687b9ef80.tar.gz bcm5719-llvm-44ec69efe0c139020d3c94ed7ec995e687b9ef80.zip |
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.
llvm-svn: 150582
Diffstat (limited to 'llvm/lib/MC/MCELFStreamer.cpp')
-rw-r--r-- | llvm/lib/MC/MCELFStreamer.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCELFStreamer.cpp b/llvm/lib/MC/MCELFStreamer.cpp index 607e01cd821..6c4d0e33a11 100644 --- a/llvm/lib/MC/MCELFStreamer.cpp +++ b/llvm/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) { |