From 1524f62b975523ce2bec5ad82873303e8e2e0dbc Mon Sep 17 00:00:00 2001 From: Alex Bradbury Date: Tue, 1 Nov 2016 16:59:37 +0000 Subject: [RISCV] Add RISC-V ELF defines Add the necessary definitions for RISC-V ELF files, including relocs. Also make necessary trivial change to ELFYaml, llvm-objdump, and llvm-readobj in order to work with RISC-V ELFs. Differential Revision: https://reviews.llvm.org/D23557 llvm-svn: 285708 --- llvm/lib/Object/ELF.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'llvm/lib/Object/ELF.cpp') diff --git a/llvm/lib/Object/ELF.cpp b/llvm/lib/Object/ELF.cpp index 4d37a298632..23682e1fabf 100644 --- a/llvm/lib/Object/ELF.cpp +++ b/llvm/lib/Object/ELF.cpp @@ -89,6 +89,13 @@ StringRef getELFRelocationTypeName(uint32_t Machine, uint32_t Type) { break; } break; + case ELF::EM_RISCV: + switch (Type) { +#include "llvm/Support/ELFRelocs/RISCV.def" + default: + break; + } + break; case ELF::EM_S390: switch (Type) { #include "llvm/Support/ELFRelocs/SystemZ.def" -- cgit v1.2.3