[PATCH] D23665: [AAP] (2) Add AAP ELF definitions
Edward Jones via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 18 08:40:30 PDT 2016
edward-jones created this revision.
edward-jones added a reviewer: rengolin.
edward-jones added subscribers: simoncook, llvm-commits.
This adds ELF defines and relocation for the AAP backend. This builds on D23664.
https://reviews.llvm.org/D23665
Files:
include/llvm/Object/ELFObjectFile.h
include/llvm/Support/ELF.h
include/llvm/Support/ELFRelocs/AAP.def
include/llvm/module.modulemap
lib/Object/ELF.cpp
Index: lib/Object/ELF.cpp
===================================================================
--- lib/Object/ELF.cpp
+++ lib/Object/ELF.cpp
@@ -40,6 +40,13 @@
break;
}
break;
+ case ELF::EM_AAP:
+ switch (Type) {
+#include "llvm/Support/ELFRelocs/AAP.def"
+ default:
+ break;
+ }
+ break;
case ELF::EM_AARCH64:
switch (Type) {
#include "llvm/Support/ELFRelocs/AArch64.def"
Index: include/llvm/module.modulemap
===================================================================
--- include/llvm/module.modulemap
+++ include/llvm/module.modulemap
@@ -260,6 +260,7 @@
textual header "Support/AArch64TargetParser.def"
textual header "Support/Dwarf.def"
textual header "Support/MachO.def"
+ textual header "Support/ELFRelocs/AAP.def"
textual header "Support/ELFRelocs/AArch64.def"
textual header "Support/ELFRelocs/AMDGPU.def"
textual header "Support/ELFRelocs/ARM.def"
Index: include/llvm/Support/ELFRelocs/AAP.def
===================================================================
--- /dev/null
+++ include/llvm/Support/ELFRelocs/AAP.def
@@ -0,0 +1,23 @@
+
+#ifndef ELF_RELOC
+#error "ELF_RELOC must be defined"
+#endif
+
+ELF_RELOC(R_AAP_NONE, 0x00)
+ELF_RELOC(R_AAP_8, 0x01)
+ELF_RELOC(R_AAP_16, 0x02)
+ELF_RELOC(R_AAP_32, 0x03)
+ELF_RELOC(R_AAP_64, 0x04)
+ELF_RELOC(R_AAP_BR16, 0x05)
+ELF_RELOC(R_AAP_BR32, 0x06)
+ELF_RELOC(R_AAP_BRCC16, 0x07)
+ELF_RELOC(R_AAP_BRCC32, 0x08)
+ELF_RELOC(R_AAP_BAL16, 0x09)
+ELF_RELOC(R_AAP_BAL32, 0x0a)
+ELF_RELOC(R_AAP_ABS6, 0x0b)
+ELF_RELOC(R_AAP_ABS9, 0x0c)
+ELF_RELOC(R_AAP_ABS10, 0x0d)
+ELF_RELOC(R_AAP_ABS12, 0x0e)
+ELF_RELOC(R_AAP_ABS16, 0x0f)
+ELF_RELOC(R_AAP_OFF10, 0x10)
+ELF_RELOC(R_AAP_SHIFT6, 0x11)
Index: include/llvm/Support/ELF.h
===================================================================
--- include/llvm/Support/ELF.h
+++ include/llvm/Support/ELF.h
@@ -317,6 +317,11 @@
// such numbers for an official value for WebAssembly. As soon as one is
// allocated, this enum will be updated to use it.
EM_WEBASSEMBLY = 0x4157, // WebAssembly architecture
+
+ // A request has been made to the maintainer of the official registry for
+ // such numbers for an official value for AAP. As soon as one is allocated,
+ // this enum will be updated to use it.
+ EM_AAP = 0x5343 // AAP
};
// Object file classes.
@@ -622,6 +627,11 @@
#include "ELFRelocs/BPF.def"
};
+// ELF Relocation type for AAP.
+enum {
+#include "ELFRelocs/AAP.def"
+};
+
#undef ELF_RELOC
// Section header.
Index: include/llvm/Object/ELFObjectFile.h
===================================================================
--- include/llvm/Object/ELFObjectFile.h
+++ include/llvm/Object/ELFObjectFile.h
@@ -861,6 +861,8 @@
return "ELF32-wasm";
case ELF::EM_AMDGPU:
return "ELF32-amdgpu";
+ case ELF::EM_AAP:
+ return "ELF32-aap";
default:
return "ELF32-unknown";
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23665.68541.patch
Type: text/x-patch
Size: 3040 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160818/f76c6b60/attachment.bin>
More information about the llvm-commits
mailing list