summaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorCarlo Kok <ck@remobjects.com>2013-08-02 16:14:15 +0000
committerCarlo Kok <ck@remobjects.com>2013-08-02 16:14:15 +0000
commitfdabd9f391c1c32c8800d1a07b03604b4a00ef3b (patch)
tree111b366b7c0fa282a01623a38e8587d9d5b4cdb4 /lib/CodeGen
parente57343b6365df5b7318c5076f917ad40cf621555 (diff)
downloadllvm-fdabd9f391c1c32c8800d1a07b03604b4a00ef3b.tar.gz
llvm-fdabd9f391c1c32c8800d1a07b03604b4a00ef3b.tar.bz2
llvm-fdabd9f391c1c32c8800d1a07b03604b4a00ef3b.tar.xz
Bugfix for making the DWARF debug strings and labels to code emitted as secrel32 instead of long opcodes (only for coff). This makes them debuggable with GDB (with fix for 64bits msvc)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187656 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinter.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 748259e298..0c59286fa9 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1416,6 +1416,10 @@ void AsmPrinter::EmitLabelOffsetDifference(const MCSymbol *Hi, uint64_t Offset,
void AsmPrinter::EmitLabelPlusOffset(const MCSymbol *Label, uint64_t Offset,
unsigned Size)
const {
+ if (MAI->needsDwarfSectionOffsetDirective() && Size == 4) { // secrel32 ONLY works for 32bits.
+ OutStreamer.EmitCOFFSecRel32(Label);
+ return;
+ }
// Emit Label+Offset (or just Label if Offset is zero)
const MCExpr *Expr = MCSymbolRefExpr::Create(Label, OutContext);