This is an archive of the discontinued LLVM Phabricator instance.

[BOLT] AArch64: Read all static relocations
ClosedPublic

Authored by yota9 on Mar 20 2022, 7:17 AM.

Details

Summary

Read static relocs on the same address, as dynamic in order to update
constant island data address properly.

Diff Detail

Event Timeline

yota9 created this revision.Mar 20 2022, 7:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 20 2022, 7:17 AM
yota9 requested review of this revision.Mar 20 2022, 7:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 20 2022, 7:17 AM

Can you give more details on what is broken when only the dynamic relocation is consumed? I'm also eager for the aarch64 tests to be enabled on x86 as well, so I can build these on my machine and inspect to understand what's being fixed. Let me know if this test is going to be enabled for x86 as well.

yota9 added a comment.EditedMar 28 2022, 3:41 PM

Can you give more details on what is broken when only the dynamic relocation is consumed?

From the runtime standpoint nothing is broken, since we update dynamic relocations and at runtime the memory value would be right. Without static relocation the value won't be updated in place in the binary. I just don't see any reason for aarch64 to skip the static relocations currently. Also the D122106 needs this patch so both static and dynamic relocs would be available.

I'm also eager for the aarch64 tests to be enabled on x86 as well,

I'm trying to write cross-platform tests when possible. As for X86 - the condition to skip static relocs was added on purpose, according to @maksfb commit message it was done because "BOLT fails
to validate the extracted value at the address.". We validate values only for x86 currently, so this problem does not affect aarch64 platform. I think it is out of scope of this review to fix x86 platform too :)

This revision is now accepted and ready to land.Apr 1 2022, 12:03 PM
This revision was automatically updated to reflect the committed changes.