[all-commits] [llvm/llvm-project] 1cf812: [JITLink] Add eh-frame CFI inspector, fix crash on...

lhames via All-commits all-commits at lists.llvm.org
Sun Aug 14 10:52:35 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1cf81274f425164ff701e180383cdb0be6add85e
      https://github.com/llvm/llvm-project/commit/1cf81274f425164ff701e180383cdb0be6add85e
  Author: Lang Hames <lhames at gmail.com>
  Date:   2022-08-14 (Sun, 14 Aug 2022)

  Changed paths:
    M llvm/include/llvm/ExecutionEngine/JITLink/EHFrameSupport.h
    M llvm/include/llvm/ExecutionEngine/JITLink/MachO_arm64.h
    M llvm/include/llvm/ExecutionEngine/JITLink/aarch64.h
    M llvm/lib/ExecutionEngine/JITLink/EHFrameSupport.cpp
    M llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp
    M llvm/unittests/ExecutionEngine/JITLink/CMakeLists.txt
    A llvm/unittests/ExecutionEngine/JITLink/EHFrameSupportTests.cpp

  Log Message:
  -----------
  [JITLink] Add eh-frame CFI inspector, fix crash on malformed FDEs.

Add a fix to check that FDE pc-begin targets are defined before calling
getBlock (which will crash if the target is not defined). FDE pc-begins
pointing at undefined symbols are expected to arise only in obscure
circumstances (malformed objects, or removal of targets by JITLink
passes), but we want to handle them gracefully. With this patch the
FDE will be retained, but without any keepalive edge to it. Unless
some pass takes action to mark it as live it will be dead-stripped.

To make it easier for passes to connect FDEs to their targets a new
EHFrameCFIBlockInspector utility is added. This allows clients to
quickly determine whether a CFI record is a CIE or an FDE (assuming
that it's valid), and retrieve any personality, pc-begin, cie, or
LSDA edges associated with it.




More information about the All-commits mailing list