This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC][LLD] Fix linking weak hidden callees.
AbandonedPublic

Authored by stefanp on Feb 14 2022, 1:21 PM.

Details

Reviewers
nemanjai
sfertile
MaskRay
Group Reviewers
Restricted Project
Summary

It seems that linking functions that are marked as weak and hidden is no longer
working because the linker incorrectly asumes that it needs a thunk for the
call. The linker converts weak hidden functions into local functions before the
call the check if a Thunk is needed and so isWeakUndef() no longer returns true.

This patch adds a check to look for local and undef.

Diff Detail

Event Timeline

stefanp created this revision.Feb 14 2022, 1:21 PM
stefanp requested review of this revision.Feb 14 2022, 1:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 14 2022, 1:21 PM
stefanp added a reviewer: Restricted Project.Feb 14 2022, 1:22 PM

This fixes an assertion failure assert(sym->getVA()); in PPC64LongBranchTargetSection::writeTo for a -no-pie link.

I am still experimenting and think that we can actually simplify the condition to

if (s.isUndefined())

Let me figure out what tests need to be adjusted.

stefanp abandoned this revision.Feb 15 2022, 12:06 PM

MaskRay has fixed the issue with https://reviews.llvm.org/D119787

I'm going to abandon this patch.