[PATCH] D72267: [LLD][ELF][AArch64] Do not use thunk for undefined weak symbol.

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 6 06:51:33 PST 2020


peter.smith created this revision.
peter.smith added reviewers: ruiu, MaskRay, grimar.
Herald added subscribers: kristof.beyls, arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.

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. The tests for both Arm and AArch64 undefined weak have been updated to use a higher address that would detect the original problem reported in pr44451

      

fixes pr44451


https://reviews.llvm.org/D72267

Files:
  lld/ELF/Arch/AArch64.cpp
  lld/test/ELF/aarch64-undefined-weak.s
  lld/test/ELF/arm-undefined-weak.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72267.236354.patch
Type: text/x-patch
Size: 4808 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200106/2e9349c2/attachment.bin>


More information about the llvm-commits mailing list