Move the ARM reloc constants to Support/ELF.h

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120035 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jason W Kim 2010-11-23 19:40:36 +00:00
parent 626613d5e8
commit 13534672de
3 changed files with 142 additions and 142 deletions

View File

@ -289,6 +289,144 @@ enum {
R_MICROBLAZE_COPY = 21
};
// ELF Relocation types for ARM
// Meets 2.08 ABI Specs.
enum {
R_ARM_NONE = 0x00,
R_ARM_PC24 = 0x01,
R_ARM_ABS32 = 0x02,
R_ARM_REL32 = 0x03,
R_ARM_LDR_PC_G0 = 0x04,
R_ARM_ABS16 = 0x05,
R_ARM_ABS12 = 0x06,
R_ARM_THM_ABS5 = 0x07,
R_ARM_ABS8 = 0x08,
R_ARM_SBREL32 = 0x09,
R_ARM_THM_CALL = 0x0a,
R_ARM_THM_PC8 = 0x0b,
R_ARM_BREL_ADJ = 0x0c,
R_ARM_TLS_DESC = 0x0d,
R_ARM_THM_SWI8 = 0x0e,
R_ARM_XPC25 = 0x0f,
R_ARM_THM_XPC22 = 0x10,
R_ARM_TLS_DTPMOD32 = 0x11,
R_ARM_TLS_DTPOFF32 = 0x12,
R_ARM_TLS_TPOFF32 = 0x13,
R_ARM_COPY = 0x14,
R_ARM_GLOB_DAT = 0x15,
R_ARM_JUMP_SLOT = 0x16,
R_ARM_RELATIVE = 0x17,
R_ARM_GOTOFF32 = 0x18,
R_ARM_BASE_PREL = 0x19,
R_ARM_GOT_BREL = 0x1a,
R_ARM_PLT32 = 0x1b,
R_ARM_CALL = 0x1c,
R_ARM_JUMP24 = 0x1d,
R_ARM_THM_JUMP24 = 0x1e,
R_ARM_BASE_ABS = 0x1f,
R_ARM_ALU_PCREL_7_0 = 0x20,
R_ARM_ALU_PCREL_15_8 = 0x21,
R_ARM_ALU_PCREL_23_15 = 0x22,
R_ARM_LDR_SBREL_11_0_NC = 0x23,
R_ARM_ALU_SBREL_19_12_NC = 0x24,
R_ARM_ALU_SBREL_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R_ARM_PRIVATE_15 = 0x7f,
R_ARM_ME_TOO = 0x80,
R_ARM_THM_TLS_DESCSEQ16 = 0x81,
R_ARM_THM_TLS_DESCSEQ32 = 0x82
};
// Section header.
struct Elf32_Shdr {

View File

@ -17,6 +17,7 @@
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Support/ELF.h"
using namespace llvm;
@ -42,9 +43,9 @@ unsigned ARMELFWriterInfo::getRelocationType(unsigned MachineRelTy) const {
case ARM::reloc_arm_pic_jt:
assert(0 && "unsupported ARM relocation type"); break;
case ARM::reloc_arm_branch: return R_ARM_CALL; break;
case ARM::reloc_arm_movt: return R_ARM_MOVT_ABS; break;
case ARM::reloc_arm_movw: return R_ARM_MOVW_ABS_NC; break;
case ARM::reloc_arm_branch: return ELF::R_ARM_CALL; break;
case ARM::reloc_arm_movt: return ELF::R_ARM_MOVT_ABS; break;
case ARM::reloc_arm_movw: return ELF::R_ARM_MOVW_ABS_NC; break;
default:
llvm_unreachable("unknown ARM relocation type"); break;
}

View File

@ -19,145 +19,6 @@
namespace llvm {
class ARMELFWriterInfo : public TargetELFWriterInfo {
// ELF Relocation types for ARM
// Meets 2.08 ABI Specs. Most of these are not used by the assembler.
// They are here for completeness's sake
enum ARMRelocationType {
R_ARM_NONE = 0x00,
R_ARM_PC24 = 0x01,
R_ARM_ABS32 = 0x02,
R_ARM_REL32 = 0x03,
R_ARM_LDR_PC_G0 = 0x04,
R_ARM_ABS16 = 0x05,
R_ARM_ABS12 = 0x06,
R_ARM_THM_ABS5 = 0x07,
R_ARM_ABS8 = 0x08,
R_ARM_SBREL32 = 0x09,
R_ARM_THM_CALL = 0x0a,
R_ARM_THM_PC8 = 0x0b,
R_ARM_BREL_ADJ = 0x0c,
R_ARM_TLS_DESC = 0x0d,
R_ARM_THM_SWI8 = 0x0e,
R_ARM_XPC25 = 0x0f,
R_ARM_THM_XPC22 = 0x10,
R_ARM_TLS_DTPMOD32 = 0x11,
R_ARM_TLS_DTPOFF32 = 0x12,
R_ARM_TLS_TPOFF32 = 0x13,
R_ARM_COPY = 0x14,
R_ARM_GLOB_DAT = 0x15,
R_ARM_JUMP_SLOT = 0x16,
R_ARM_RELATIVE = 0x17,
R_ARM_GOTOFF32 = 0x18,
R_ARM_BASE_PREL = 0x19,
R_ARM_GOT_BREL = 0x1a,
R_ARM_PLT32 = 0x1b,
R_ARM_CALL = 0x1c,
R_ARM_JUMP24 = 0x1d,
R_ARM_THM_JUMP24 = 0x1e,
R_ARM_BASE_ABS = 0x1f,
R_ARM_ALU_PCREL_7_0 = 0x20,
R_ARM_ALU_PCREL_15_8 = 0x21,
R_ARM_ALU_PCREL_23_15 = 0x22,
R_ARM_LDR_SBREL_11_0_NC = 0x23,
R_ARM_ALU_SBREL_19_12_NC = 0x24,
R_ARM_ALU_SBREL_27_20_CK = 0x25,
R_ARM_TARGET1 = 0x26,
R_ARM_SBREL31 = 0x27,
R_ARM_V4BX = 0x28,
R_ARM_TARGET2 = 0x29,
R_ARM_PREL31 = 0x2a,
R_ARM_MOVW_ABS_NC = 0x2b,
R_ARM_MOVT_ABS = 0x2c,
R_ARM_MOVW_PREL_NC = 0x2d,
R_ARM_MOVT_PREL = 0x2e,
R_ARM_THM_MOVW_ABS_NC = 0x2f,
R_ARM_THM_MOVT_ABS = 0x30,
R_ARM_THM_MOVW_PREL_NC = 0x31,
R_ARM_THM_MOVT_PREL = 0x32,
R_ARM_THM_JUMP19 = 0x33,
R_ARM_THM_JUMP6 = 0x34,
R_ARM_THM_ALU_PREL_11_0 = 0x35,
R_ARM_THM_PC12 = 0x36,
R_ARM_ABS32_NOI = 0x37,
R_ARM_REL32_NOI = 0x38,
R_ARM_ALU_PC_G0_NC = 0x39,
R_ARM_ALU_PC_G0 = 0x3a,
R_ARM_ALU_PC_G1_NC = 0x3b,
R_ARM_ALU_PC_G1 = 0x3c,
R_ARM_ALU_PC_G2 = 0x3d,
R_ARM_LDR_PC_G1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a,
R_ARM_TLS_IE32 = 0x6b,
R_ARM_TLS_LE32 = 0x6c,
R_ARM_TLS_LDO12 = 0x6d,
R_ARM_TLS_LE12 = 0x6e,
R_ARM_TLS_IE12GP = 0x6f,
R_ARM_PRIVATE_0 = 0x70,
R_ARM_PRIVATE_1 = 0x71,
R_ARM_PRIVATE_2 = 0x72,
R_ARM_PRIVATE_3 = 0x73,
R_ARM_PRIVATE_4 = 0x74,
R_ARM_PRIVATE_5 = 0x75,
R_ARM_PRIVATE_6 = 0x76,
R_ARM_PRIVATE_7 = 0x77,
R_ARM_PRIVATE_8 = 0x78,
R_ARM_PRIVATE_9 = 0x79,
R_ARM_PRIVATE_10 = 0x7a,
R_ARM_PRIVATE_11 = 0x7b,
R_ARM_PRIVATE_12 = 0x7c,
R_ARM_PRIVATE_13 = 0x7d,
R_ARM_PRIVATE_14 = 0x7e,
R_ARM_PRIVATE_15 = 0x7f,
R_ARM_ME_TOO = 0x80,
R_ARM_THM_TLS_DESCSEQ16 = 0x81,
R_ARM_THM_TLS_DESCSEQ32 = 0x82
};
public:
ARMELFWriterInfo(TargetMachine &TM);
virtual ~ARMELFWriterInfo();