This is an archive of the discontinued LLVM Phabricator instance.

[JITLink][PowerPC] Change method to check if a symbol is external to current object
ClosedPublic

Authored by lkail on Jul 21 2023, 1:59 AM.

Details

Summary

After PrePrunePass claimOrExternalizeWeakAndCommonSymbols, a defined symbol might become external. So determine a function call is external or not when building the linkgraph is not accurate. This largely affects updating TOC pointer on PowerPC. TOC pointer is supposed to be the same in one object file(if no mulitple TOC appears) and is updated when control flow transferred to another object file.

This patch defers checking a function call is external or not, in buildTables_ELF_ppc64 which is a PostPrunePass.

This patch fixes failures when jitlink -orc-runtime=/path/to/libort_rt.a is used.

Diff Detail

Unit TestsFailed

Event Timeline

lkail created this revision.Jul 21 2023, 1:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2023, 1:59 AM
lkail requested review of this revision.Jul 21 2023, 1:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2023, 1:59 AM
lkail edited the summary of this revision. (Show Details)Jul 21 2023, 2:23 AM
lkail edited the summary of this revision. (Show Details)Jul 21 2023, 2:25 AM
lkail updated this revision to Diff 543800.Jul 24 2023, 8:11 PM
lkail edited the summary of this revision. (Show Details)
lkail edited the summary of this revision. (Show Details)Jul 24 2023, 8:13 PM
lkail updated this revision to Diff 543831.Jul 24 2023, 11:20 PM
lkail edited the summary of this revision. (Show Details)
lkail edited the summary of this revision. (Show Details)
lkail edited the summary of this revision. (Show Details)Jul 24 2023, 11:25 PM
lkail updated this revision to Diff 543865.Jul 25 2023, 1:30 AM
lkail retitled this revision from [JITLink][PowerPC][WIP] Change method to check if a symbol is external to current object to [JITLink][PowerPC] Change method to check if a symbol is external to current object.
lkail added reviewers: lhames, MaskRay, Restricted Project, stefanp, sfertile.
lkail edited the summary of this revision. (Show Details)Jul 25 2023, 1:40 AM
lhames accepted this revision.Jul 25 2023, 8:13 AM

LGTM. Thanks @lkail!

This revision is now accepted and ready to land.Jul 25 2023, 8:13 AM
This revision was landed with ongoing or failed builds.Jul 25 2023, 8:21 PM
This revision was automatically updated to reflect the committed changes.