[all-commits] [llvm/llvm-project] 53b59f: [ELF][PPC64] Fix assertion failure for branches to...

Fangrui Song via All-commits all-commits at lists.llvm.org
Tue Feb 15 12:57:41 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 53b59fdc52bf6c8bf15ce7c146d2cebe338f34a7
      https://github.com/llvm/llvm-project/commit/53b59fdc52bf6c8bf15ce7c146d2cebe338f34a7
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-02-15 (Tue, 15 Feb 2022)

  Changed paths:
    M lld/ELF/Arch/PPC64.cpp
    A lld/test/ELF/ppc64-undefined-weak.s
    A lld/test/ELF/ppc64-undefined.s
    R lld/test/ELF/ppc64-weak-undef-call-shared.s
    R lld/test/ELF/ppc64-weak-undef-call.s

  Log Message:
  -----------
  [ELF][PPC64] Fix assertion failure for branches to hidden undefined weak for -no-pie

Reported by Stefan Pintilie in D119773.

For a branch to a hidden undefined weak symbol, there is an
`assert(sym->getVA());` failure in PPC64LongBranchTargetSection::writeTo for a
-no-pie link. The root cause is that we unnecessarily create the thunk for the
-no-pie link.

Fix this by changing the condition to just `s.isUndefined()`. See the inline
comment.

Rename ppc64-weak-undef-call.s to ppc64-undefined-weak.s to be consistent with
other architectures.

Reviewed By: sfertile, stefanp

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




More information about the All-commits mailing list