[PATCH] D126287: [JITLink][ELF/AARCH64] Implement R_AARCH64_ADR_PREL_PG_HI21 and R_AARCH64_ADD_ABS_LO12_NC
Sunho Kim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 24 03:32:13 PDT 2022
sunho created this revision.
Herald added subscribers: hiraditya, kristof.beyls.
Herald added a project: All.
sunho requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
This implements R_AARCH64_ADR_PREL_PG_HI21 and R_AARCH64_ADD_ABS_LO12_NC fixup edges using the generic aarch64 patch edges.
Depends on these two patches:
https://reviews.llvm.org/D126286
https://reviews.llvm.org/D126284
https://reviews.llvm.org/D126287
Files:
llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch64.h
llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
Index: llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
===================================================================
--- llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
+++ llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp
@@ -51,6 +51,10 @@
switch (Type) {
case ELF::R_AARCH64_CALL26:
return ELF_aarch64_Edges::R_AARCH64_CALL26;
+ case ELF::R_AARCH64_ADR_PREL_PG_HI21:
+ return ELF_aarch64_Edges::R_AARCH64_ADR_PREL_PG_HI21;
+ case ELF::R_AARCH64_ADD_ABS_LO12_NC:
+ return ELF_aarch64_Edges::R_AARCH64_ADD_ABS_LO12_NC;
}
return make_error<JITLinkError>("Unsupported aarch64 relocation:" +
@@ -107,6 +111,14 @@
Kind = aarch64::Branch26;
break;
}
+ case R_AARCH64_ADR_PREL_PG_HI21: {
+ Kind = aarch64::Page21;
+ break;
+ case R_AARCH64_ADD_ABS_LO12_NC: {
+ Kind = aarch64::PageOffset12;
+ break;
+ }
+ }
default:
llvm_unreachable("Special relocation kind should not appear in "
"elf file");
@@ -171,6 +183,10 @@
switch (R) {
case ELF_aarch64_Edges::R_AARCH64_CALL26:
return "R_AARCH64_CALL26";
+ case ELF_aarch64_Edges::R_AARCH64_ADR_PREL_PG_HI21:
+ return "R_AARCH64_ADR_PREL_PG_HI21";
+ case ELF_aarch64_Edges::R_AARCH64_ADD_ABS_LO12_NC:
+ return "R_AARCH64_ADD_ABS_LO12_NC";
default:
llvm_unreachable("unhandled elf relocation kind name");
}
Index: llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch64.h
===================================================================
--- llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch64.h
+++ llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch64.h
@@ -23,6 +23,8 @@
namespace ELF_aarch64_Edges {
enum ELFAarch64RelocationKind : Edge::Kind {
R_AARCH64_CALL26 = Edge::FirstRelocation,
+ R_AARCH64_ADR_PREL_PG_HI21,
+ R_AARCH64_ADD_ABS_LO12_NC,
};
} // namespace ELF_aarch64_Edges
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126287.431632.patch
Type: text/x-patch
Size: 1905 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220524/72437a73/attachment.bin>
More information about the llvm-commits
mailing list