[all-commits] [llvm/llvm-project] 3fabda: [JITLink] Use Section + Offset format for anon sym...

lhames via All-commits all-commits at lists.llvm.org
Tue Jan 11 23:09:25 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3fabda51a6d7b099295b8ef297b24b32d6a37ac1
      https://github.com/llvm/llvm-project/commit/3fabda51a6d7b099295b8ef297b24b32d6a37ac1
  Author: Lang Hames <lhames at gmail.com>
  Date:   2022-01-12 (Wed, 12 Jan 2022)

  Changed paths:
    M llvm/lib/ExecutionEngine/JITLink/JITLink.cpp

  Log Message:
  -----------
  [JITLink] Use Section + Offset format for anon symbols in out-of-range errors.

The previous error message only provided the address of the anonymous symbol.
Knowing the containing section makes the error easier to diagnose at a glance.


  Commit: c2ba53518f5459b8e61c44549358065208d62125
      https://github.com/llvm/llvm-project/commit/c2ba53518f5459b8e61c44549358065208d62125
  Author: Lang Hames <lhames at gmail.com>
  Date:   2022-01-12 (Wed, 12 Jan 2022)

  Changed paths:
    M llvm/include/llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h

  Log Message:
  -----------
  [ORC] Add an ostream operator for ExecutorAddrRange.

This makes it easier to print addr ranges in debugging output.


  Commit: 1f3d4525d87e9cd69c18098449a21ed0199fc459
      https://github.com/llvm/llvm-project/commit/1f3d4525d87e9cd69c18098449a21ed0199fc459
  Author: Lang Hames <lhames at gmail.com>
  Date:   2022-01-12 (Wed, 12 Jan 2022)

  Changed paths:
    M llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp
    A llvm/test/ExecutionEngine/JITLink/AArch64/MachO_arm64_stub_to_got_distance_stress_test.s

  Log Message:
  -----------
  [JITLink][AArch64] Use R-X permissions for the GOT.

This consistent with ld64's treatment of the GOT, but the main aim here is a
short-term workaround for a bad interaction between stub code sequences and
memory layout: Stubs use LDRLiteral19 relocations to reference the GOT, but
BasicLayout currently puts RW- segments between R-- and R-X segments -- a large
RW- segment (or a large R-- for that matter) can cause the relocation to fail
with an out-of-range error.

Putting the GOT in R-X fixes this efficiently in practice. A more robust fix
will be to use a longer code sequence to materialize the GOT pointer and then
rewrite the stub to use a shorter sequence where possible.


Compare: https://github.com/llvm/llvm-project/compare/62790f366fbe...1f3d4525d87e


More information about the All-commits mailing list