This is an archive of the discontinued LLVM Phabricator instance.

[JITLink][AARCH64] Fix overflow range of Page21
ClosedPublic

Authored by sunho on May 25 2022, 8:26 AM.

Details

Summary

Allowed range for Page21 relocation is -2^32 <= X < 2^32 in both ELF and MachO.

https://github.com/llvm/llvm-project/blob/09c2b7c35af8c4bad39f03e9f60df8bd07323028/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOAArch64.h#L210 (MachO)

ELF for the ARM ® 64-bit Architecture (AArch64) Table 4-9 (ELF)

Diff Detail

Event Timeline

sunho created this revision.May 25 2022, 8:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 25 2022, 8:26 AM
sunho requested review of this revision.May 25 2022, 8:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 25 2022, 8:26 AM
sunho retitled this revision from [JITLINK][AARCH64] Fix overflow range of Page21 to [JITLink][AARCH64] Fix overflow range of Page21.May 25 2022, 8:26 AM
sunho added a comment.May 25 2022, 8:30 AM

In ELF there's "no overflow check" relocations entries. (for page21, it's R_AARCH64_ ADR_PREL_PG_HI21_NC) Something to be considered later.

sgraenitz accepted this revision.May 30 2022, 12:10 AM

Good catch!

This revision is now accepted and ready to land.May 30 2022, 12:10 AM
sunho updated this revision to Diff 432860.May 30 2022, 12:56 AM

Rebase on updated generic aarch64 fixup patch.

This revision was landed with ongoing or failed builds.Jun 9 2022, 6:30 PM
This revision was automatically updated to reflect the committed changes.