This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Remove needsPltAddr in favor of needsCopy

Authored by MaskRay on Dec 12 2021, 1:27 PM.



needsPltAddr is equivalent to needsCopy && isFunc. In many places, it is
equivalent to needsCopy because the non-STT_FUNC cases are ruled out.

Diff Detail

Event Timeline

MaskRay created this revision.Dec 12 2021, 1:27 PM
MaskRay requested review of this revision.Dec 12 2021, 1:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 12 2021, 1:27 PM
peter.smith accepted this revision.Dec 13 2021, 3:54 AM

LGTM, although worth waiting a bit to see what others think.

I'm still wondering if we can find a better name than needsCopy; I still haven't come up with a better one. It would need a word that captures the abstraction of a "copy relocation" and "canonical PLT entry" without being so close to one of them that it implies just that one thing yet self descriptive on what the need is for. The best I can come up with is needsCanonicalDefinition but not sure that is better than needsCopy.

This revision is now accepted and ready to land.Dec 13 2021, 3:54 AM

needsCopy is declared as a temporary flag and, according to its comment, should not be used after postScanRelocations(). Because the usage is extended, that should be reflected in the comment.

MaskRay updated this revision to Diff 393964.Dec 13 2021, 10:45 AM

Rebase after needsCopy has a better comment.

This revision was automatically updated to reflect the committed changes.