aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCDwarf.cpp
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2019-11-23 00:46:24 +0200
committerMartin Storsjö <martin@martin.st>2019-11-27 10:44:42 +0200
commit47046f05e66c23567d6672ea5a1afd8ed2c411ed (patch)
tree71c24f162960b1305583933b6b54247e11961c32 /llvm/lib/MC/MCDwarf.cpp
parent943513b79929fba1a9dccdf81cb68a41ce29cd03 (diff)
downloadllvm-47046f05e66c23567d6672ea5a1afd8ed2c411ed.zip
llvm-47046f05e66c23567d6672ea5a1afd8ed2c411ed.tar.gz
llvm-47046f05e66c23567d6672ea5a1afd8ed2c411ed.tar.bz2
[MC] Produce proper section relative relocations for COFF in .debug_frame
The third parameter to Streamer.EmitSymbolValue() is "bool IsSectionRelative = false". For ELF, these debug sections are mapped to address zero, so a normal, absolute address relocation works just fine, but COFF needs a section relative relocation, and COFF is the only target where needsDwarfSectionOffsetDirective() returns true. This matches how EmitSymbolValue is called elsewhere in the same source file. Differential Revision: https://reviews.llvm.org/D70661
Diffstat (limited to 'llvm/lib/MC/MCDwarf.cpp')
-rw-r--r--llvm/lib/MC/MCDwarf.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp
index bcc7c45..b4b3c99 100644
--- a/llvm/lib/MC/MCDwarf.cpp
+++ b/llvm/lib/MC/MCDwarf.cpp
@@ -1701,7 +1701,8 @@ void FrameEmitterImpl::EmitFDE(const MCSymbol &cieStart,
MakeStartMinusEndExpr(Streamer, SectionStart, cieStart, 0);
emitAbsValue(Streamer, offset, 4);
} else {
- Streamer.EmitSymbolValue(&cieStart, 4);
+ Streamer.EmitSymbolValue(&cieStart, 4,
+ asmInfo->needsDwarfSectionOffsetDirective());
}
// PC Begin