[JITLink] Refactor EH-frame handling to support eh-frames with existing relocs.Some targets (E.g. MachO/arm64) use relocations to fix some CFI record fieldsin the eh-frame section. When relocation
[JITLink] Refactor EH-frame handling to support eh-frames with existing relocs.Some targets (E.g. MachO/arm64) use relocations to fix some CFI record fieldsin the eh-frame section. When relocations are used the initial (pre-relocation)content of the eh-frame section can no longer be interpreted by following theeh-frame specification. This causes errors in the existing eh-frame parser.This patch moves eh-frame handling into two LinkGraph passes that are run afterrelocations have been parsed (but before they are applied). The first] passbreaks up blocks in the eh-frame section into per-CFI-record blocks, and thesecond parses blocks of (potentially multiple) CFI records and adds theappropriate edges to any CFI fields that do not have existing relocations.These passes can be run independently of one another. By handling eh-framesplitting/fixing with LinkGraph passes we can both re-use existing relocationsfor CFI record fields and avoid applying eh-frame fixups before parsing thesection (which would complicate the linker and require extra temporaryallocations of working memory).
show more ...