This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Make TargetInfo::writeIgotPlt a no-op
ClosedPublic

Authored by MaskRay on Jan 9 2020, 12:09 PM.

Details

Summary

RELA targets don't read initial .got.plt entries.
REL targets (ARM, x86-32) write the address of the IFUNC resolver to the
entry (write32le(buf, s.getVA())).

The default writeIgotPlt() is not meaningful. Make it a no-op. AArch64
and x86-64 will have 0 as initial .got.plt entries associated with
IFUNC.

Diff Detail

Event Timeline

MaskRay created this revision.Jan 9 2020, 12:09 PM

Unit tests: pass. 61723 tests passed, 0 failed and 779 were skipped.

clang-tidy: fail. Please fix clang-tidy findings.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

peter.smith accepted this revision.Jan 10 2020, 4:22 AM

LGTM. ld.bfd, at least on AARCH64 will write the address of PLT[0] into the .got.plt, but this may just be out of convenience as it will be overwritten by the IRELATIVE relocation before it can be used.

This revision is now accepted and ready to land.Jan 10 2020, 4:22 AM
This revision was automatically updated to reflect the committed changes.