aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/ELF.cpp
diff options
context:
space:
mode:
authorZi Xuan Wu <zixuan.wu@linux.alibaba.com>2020-09-02 17:02:17 +0800
committerZi Xuan Wu <zixuan.wu@linux.alibaba.com>2020-09-07 10:42:28 +0800
commit69f2c79f2ad2c3ebdb000cb1311612db7bd2bef8 (patch)
treefc3a579dd3ab5dc43575a840f5963a6dfe56cfbe /llvm/lib/Object/ELF.cpp
parentd5c45041f1465f4ecc3828efbbb27aa7b4d23d89 (diff)
downloadllvm-69f2c79f2ad2c3ebdb000cb1311612db7bd2bef8.zip
llvm-69f2c79f2ad2c3ebdb000cb1311612db7bd2bef8.tar.gz
llvm-69f2c79f2ad2c3ebdb000cb1311612db7bd2bef8.tar.bz2
[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
Diffstat (limited to 'llvm/lib/Object/ELF.cpp')
-rw-r--r--llvm/lib/Object/ELF.cpp9
1 files changed, 9 insertions, 0 deletions
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 @@ StringRef llvm::object::getELFRelocationTypeName(uint32_t Machine,
break;
}
break;
+ case ELF::EM_CSKY:
+ switch (Type) {
+#include "llvm/BinaryFormat/ELFRelocs/CSKY.def"
+ default:
+ break;
+ }
+ break;
default:
break;
}
@@ -194,6 +201,8 @@ uint32_t llvm::object::getELFRelativeRelocationType(uint32_t Machine) {
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: