This is an archive of the discontinued LLVM Phabricator instance.

[MC] Produce proper section relative relocations for COFF in .debug_frame
ClosedPublic

Authored by mstorsjo on Nov 25 2019, 2:13 AM.

Diff Detail

Event Timeline

mstorsjo created this revision.Nov 25 2019, 2:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 25 2019, 2:13 AM
Herald added a subscriber: hiraditya. · View Herald Transcript

To clarify this change (it's rather obscure in this plain form even though the change in principle is trivial); 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.

I'll add something to this effect in the commit message as well.

labath accepted this revision.Nov 27 2019, 12:27 AM

Though I'm not very familiar with this code, I am pretty sure it's correct as the same pattern is used in other dwarf section references too.

This revision is now accepted and ready to land.Nov 27 2019, 12:27 AM
This revision was automatically updated to reflect the committed changes.