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

Fangrui Song via All-commits all-commits at lists.llvm.org
Tue Feb 15 13:01:11 PST 2022


  Branch: refs/heads/release/14.x
  Home:   https://github.com/llvm/llvm-project
  Commit: edf64474d66286a7f5578a033d1c3ccb31f2a2a7
      https://github.com/llvm/llvm-project/commit/edf64474d66286a7f5578a033d1c3ccb31f2a2a7
  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

(cherry picked from commit 53b59fdc52bf6c8bf15ce7c146d2cebe338f34a7)




More information about the All-commits mailing list