[MC] Produce proper section relative relocations for COFF in .debug_frame
authorMartin Storsjö <martin@martin.st>
Fri, 22 Nov 2019 22:46:24 +0000 (00:46 +0200)
committerMartin Storsjö <martin@martin.st>
Wed, 27 Nov 2019 08:44:42 +0000 (10:44 +0200)
commit47046f05e66c23567d6672ea5a1afd8ed2c411ed
tree71c24f162960b1305583933b6b54247e11961c32
parent943513b79929fba1a9dccdf81cb68a41ce29cd03
[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
llvm/lib/MC/MCDwarf.cpp
llvm/test/MC/COFF/cfi-sections.s [new file with mode: 0644]