summary
This patch supports the two relocation types, R_AARCH64_ADR_PREL_PG_HI21 and R_AARCH64_ADD_ABS_LO12_NC.
Test Plan:
check-llvm
Differential D118346
[ORC] Support ADR_PREL_PG_HI21 & ADD_ABS_LO12_NC for aarch64 dongAxis1944 on Jan 27 2022, 3:36 AM. Authored by
Details
Diff Detail
Unit Tests Event Timeline
Comment Actions Reviewing the patch as-is because I think it's a great addition. If work on the ELF/aarch64 backend is starting in earnest though I would prefer to create a new generic aarch64.h header (along the lines of riscv.h and x86_64.h) and populate it with the existing MachO relocations -- the fixup logic is generally sharable, so there shouldn't be any need to duplicate it, though ELF will probably require some extra relocations beyond the set MachO uses. If that sounds good to you I'll try to find some time to do that next week.
Comment Actions thanks for reviewing. I actually run the test locally, but I will rerun it again and find out the errors. Comment Actions Thanks for the patch. I can't dig into the details deeper right now, but if the test issues remain I do so next week.
Comment Actions thanks, it is wired for me. since this test just pass on my mac (T.T). I will recheck it. thanks in advance. Comment Actions @dongAxis1944 Can you still work on this? I have a fix in my local. Only few bitmask arithematic errors. |
To keep the fixup code idiomatic I would reference these values directly in each of the switch cases that use them, rather than naming them before the start of the switch.
This is particularly true for RawInstr: The fixup content isn't used for every relocation, and not all relocations are fixing up instructions.