[ELF] Add a new e_machine value EM_CSKY and add some CSKY relocation types
This is the split part of D86269, which add a new ELF machine flag called EM_CSKY and related relocations.
Some target-specific flags and tests for csky can be added in follow-up patches later.
Differential Revision: https://reviews.llvm.org/D86610
diff --git a/llvm/lib/Object/ELF.cpp b/llvm/lib/Object/ELF.cpp
index 0e06af9..c6e9ee1 100644
--- a/llvm/lib/Object/ELF.cpp
+++ b/llvm/lib/Object/ELF.cpp
@@ -152,6 +152,13 @@
break;
}
break;
+ case ELF::EM_CSKY:
+ switch (Type) {
+#include "llvm/BinaryFormat/ELFRelocs/CSKY.def"
+ default:
+ break;
+ }
+ break;
default:
break;
}
@@ -194,6 +201,8 @@
case ELF::EM_SPARC32PLUS:
case ELF::EM_SPARCV9:
return ELF::R_SPARC_RELATIVE;
+ case ELF::EM_CSKY:
+ return ELF::R_CKCORE_RELATIVE;
case ELF::EM_AMDGPU:
break;
case ELF::EM_BPF: