summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit4382da983ac09ddadc6877459c3a6dc9a6f56351 (patch)
tree67df63b566c4beb9b6e835e8944078b07a45674a /llvm/lib/CodeGen
parent11fe914549c46a3f28823bc0b7bfaa7d86239f0a (diff)
downloadbcm5719-llvm-4382da983ac09ddadc6877459c3a6dc9a6f56351.tar.gz
bcm5719-llvm-4382da983ac09ddadc6877459c3a6dc9a6f56351.zip
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)
llvm-svn: 187656
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 748259e298a..0c59286fa95 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud