[all-commits] [llvm/llvm-project] 051c4d: [LLD][ELF][AArch64] Do not use thunk for undefined...

Peter Smith via All-commits all-commits at lists.llvm.org
Tue Jan 7 01:59:01 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 051c4d5b7bcfb0c1feb69f4701086ac725322527
      https://github.com/llvm/llvm-project/commit/051c4d5b7bcfb0c1feb69f4701086ac725322527
  Author: Peter Smith <peter.smith at linaro.org>
  Date:   2020-01-07 (Tue, 07 Jan 2020)

  Changed paths:
    M lld/ELF/Arch/AArch64.cpp
    M lld/test/ELF/aarch64-undefined-weak.s
    M lld/test/ELF/arm-undefined-weak.s

  Log Message:
  -----------
  [LLD][ELF][AArch64] Do not use thunk for undefined weak symbol.

In AArch64 a branch to an undefined weak symbol that does not have a PLT
entry should resolve to the next instruction. The thunk generation code
can prevent this from happening as a range extension thunk can be generated
if the branch is sufficiently far away from 0, the value of an undefined
weak symbol.

The fix is taken from the Arm implementation of needsThunk(), we prevent a
thunk from being generated to an undefined weak symbol.

fixes pr44451

Differential Revision: https://reviews.llvm.org/D72267




More information about the All-commits mailing list