[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
Mon May 30 01:02:59 PDT 2022
sunho updated this revision to Diff 432863.
sunho added a comment.
Rename edges so that it's easy to find original relocation type.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126287/new/
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
@@ -50,7 +50,11 @@
using namespace aarch64;
switch (Type) {
case ELF::R_AARCH64_CALL26:
- return ELF_aarch64_Edges::ELFBranch26;
+ return ELF_aarch64_Edges::ELFCall26;
+ case ELF::R_AARCH64_ADR_PREL_PG_HI21:
+ return ELF_aarch64_Edges::ELFAdrPage21;
+ case ELF::R_AARCH64_ADD_ABS_LO12_NC:
+ return ELF_aarch64_Edges::ELFAddAbs12;
}
return make_error<JITLinkError>("Unsupported aarch64 relocation:" +
@@ -103,10 +107,18 @@
Edge::Kind Kind = Edge::Invalid;
switch (*RelocKind) {
- case ELFBranch26: {
+ case ELFCall26: {
Kind = aarch64::Branch26;
break;
}
+ case ELFAdrPage21: {
+ Kind = aarch64::Page21;
+ break;
+ }
+ case ELFAddAbs12: {
+ Kind = aarch64::PageOffset12;
+ break;
+ }
};
Edge GE(Kind, Offset, *GraphSymbol, Addend);
@@ -166,8 +178,12 @@
const char *getELFAArch64RelocationKindName(Edge::Kind R) {
switch (R) {
- case ELF_aarch64_Edges::ELFBranch26:
- return "ELFBranch26";
+ case ELF_aarch64_Edges::ELFCall26:
+ return "ELFCall26";
+ case ELF_aarch64_Edges::ELFAdrPage21:
+ return "ELFAdrPage21";
+ case ELF_aarch64_Edges::ELFAddAbs12:
+ return "ELFAddAbs12";
default:
return getGenericEdgeKindName(static_cast<Edge::Kind>(R));
}
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
@@ -22,7 +22,9 @@
namespace ELF_aarch64_Edges {
enum ELFAArch64RelocationKind : Edge::Kind {
- ELFBranch26 = Edge::FirstRelocation,
+ ELFCall26 = Edge::FirstRelocation,
+ ELFAdrPage21,
+ ELFAddAbs12,
};
} // namespace ELF_aarch64_Edges
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126287.432863.patch
Type: text/x-patch
Size: 2041 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220530/4fddd45e/attachment.bin>
More information about the llvm-commits
mailing list