[all-commits] [llvm/llvm-project] 76aee8: [JITLink] Refactor EH-frame handling to support eh...

lhames via All-commits all-commits at lists.llvm.org
Wed Nov 6 14:30:32 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 76aee8a389447409905c58b178b0554c9bae8a0a
      https://github.com/llvm/llvm-project/commit/76aee8a389447409905c58b178b0554c9bae8a0a
  Author: Lang Hames <lhames at gmail.com>
  Date:   2019-11-06 (Wed, 06 Nov 2019)

  Changed paths:
    M llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
    M llvm/lib/ExecutionEngine/JITLink/EHFrameSupport.cpp
    M llvm/lib/ExecutionEngine/JITLink/EHFrameSupportImpl.h
    M llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp
    M llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h
    M llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp
    M llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp
    A llvm/test/ExecutionEngine/JITLink/AArch64/Inputs/MachO_arm64_ehframe.o
    A llvm/test/ExecutionEngine/JITLink/AArch64/MachO_arm64_ehframe.test

  Log Message:
  -----------
  [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 fields
in 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 the
eh-frame specification. This causes errors in the existing eh-frame parser.

This patch moves eh-frame handling into two LinkGraph passes that are run after
relocations have been parsed (but before they are applied). The first] pass
breaks up blocks in the eh-frame section into per-CFI-record blocks, and the
second parses blocks of (potentially multiple) CFI records and adds the
appropriate edges to any CFI fields that do not have existing relocations.
These passes can be run independently of one another. By handling eh-frame
splitting/fixing with LinkGraph passes we can both re-use existing relocations
for CFI record fields and avoid applying eh-frame fixups before parsing the
section (which would complicate the linker and require extra temporary
allocations of working memory).




More information about the All-commits mailing list