This is an archive of the discontinued LLVM Phabricator instance.

[ELF] -pie: produce dynamic relocations for absolute relocations referencing undef weak
ClosedPublic

Authored by MaskRay on Jun 29 2021, 5:36 PM.

Details

Summary

See the comment for my understanding of -no-pie and -shared expectation.
-no-pie has freedom on choices. We choose dynamic relocations to be consistent
with the handling of GOT-generating relocations.

Note: GNU ld has arch-varying behaviors and its x86 -pie has a very
complex rule:
if there is at least one GOT-generating or PLT-generating relocation and
-z dynamic-undefined-weak (enabled by default) is in effect, generate a
dynamic relocation.

We don't emulate its rule.

Diff Detail

Event Timeline

MaskRay created this revision.Jun 29 2021, 5:36 PM
MaskRay requested review of this revision.Jun 29 2021, 5:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 29 2021, 5:36 PM
peter.smith accepted this revision.Jun 30 2021, 6:18 AM

LGTM thanks for the update.

This revision is now accepted and ready to land.Jun 30 2021, 6:18 AM