[all-commits] [llvm/llvm-project] f7a571: [JITLink][MachO] Fix handling of non-extern UNSIGN...

lhames via All-commits all-commits at lists.llvm.org
Sun Jul 19 10:48:31 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f7a571537a14da83e5701864471b99b61cdcca54
      https://github.com/llvm/llvm-project/commit/f7a571537a14da83e5701864471b99b61cdcca54
  Author: Lang Hames <lhames at gmail.com>
  Date:   2020-07-19 (Sun, 19 Jul 2020)

  Changed paths:
    M llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp
    M llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp
    M llvm/test/ExecutionEngine/JITLink/X86/MachO_x86-64_relocations.s

  Log Message:
  -----------
  [JITLink][MachO] Fix handling of non-extern UNSIGNED pair of SUBTRACTOR relocs.

When processing a MachO SUBTRACTOR/UNSIGNED pair, if the UNSIGNED target
is non-extern then check the r_symbolnum field of the relocation to find
the targeted section and use the section's address to find 'ToSymbol'.

Previously 'ToSymbol' was found by loading the initial value stored at
the fixup location and treating this as an address to search for. This
is incorrect, however: the initial value includes the addend and will
point to the wrong block if the addend is less than zero or greater than
the block size.

rdar://65756694




More information about the All-commits mailing list