[all-commits] [llvm/llvm-project] 01bc5b: [JITLink] Fix sorting bug for PC-begin candidate s...

lhames via All-commits all-commits at lists.llvm.org
Tue Apr 5 13:02:43 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 01bc5b703462f4cb10ed3afdfe6d00923d22dbab
      https://github.com/llvm/llvm-project/commit/01bc5b703462f4cb10ed3afdfe6d00923d22dbab
  Author: Lang Hames <lhames at gmail.com>
  Date:   2022-04-05 (Tue, 05 Apr 2022)

  Changed paths:
    M llvm/lib/ExecutionEngine/JITLink/EHFrameSupport.cpp
    M llvm/lib/ExecutionEngine/JITLink/EHFrameSupportImpl.h
    A llvm/test/ExecutionEngine/JITLink/X86/MachO_ehframe_canonical_symbol_comparison.s

  Log Message:
  -----------
  [JITLink] Fix sorting bug for PC-begin candidate symbols during EH-frame fixup.

The sort should have been lexicographic, but wasn't. This resulted in us
choosing a common symbol at address zero over the intended target function,
leading to a crash.

This patch also moves sorting up to the start of the pass, which means that we
only need to hold on to the canonical symbol at each address rather than a list
of candidates.




More information about the All-commits mailing list