[llvm] r209201 - [Mips] Add more relocation types and MIPS specific e_flags constants.
Simon Atanasyan
simon at atanasyan.com
Tue May 20 02:27:49 PDT 2014
Author: atanasyan
Date: Tue May 20 04:27:49 2014
New Revision: 209201
URL: http://llvm.org/viewvc/llvm-project?rev=209201&view=rev
Log:
[Mips] Add more relocation types and MIPS specific e_flags constants.
Modified:
llvm/trunk/include/llvm/Support/ELF.h
llvm/trunk/lib/Object/ELF.cpp
llvm/trunk/lib/Object/ELFYAML.cpp
llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
Modified: llvm/trunk/include/llvm/Support/ELF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ELF.h?rev=209201&r1=209200&r2=209201&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/ELF.h (original)
+++ llvm/trunk/include/llvm/Support/ELF.h Tue May 20 04:27:49 2014
@@ -824,11 +824,12 @@ enum : unsigned {
EF_MIPS_ARCH_64 = 0x60000000, // MIPS64 instruction set per linux not elf.h
EF_MIPS_ARCH_32R2 = 0x70000000, // mips32r2
EF_MIPS_ARCH_64R2 = 0x80000000, // mips64r2
+ EF_MIPS_ARCH_32R6 = 0x90000000, // mips32r6
+ EF_MIPS_ARCH_64R6 = 0xa0000000, // mips64r6
EF_MIPS_ARCH = 0xf0000000 // Mask for applying EF_MIPS_ARCH_ variant
};
// ELF Relocation types for Mips
-// .
enum {
R_MIPS_NONE = 0,
R_MIPS_16 = 1,
@@ -881,6 +882,12 @@ enum {
R_MIPS_TLS_TPREL_HI16 = 49,
R_MIPS_TLS_TPREL_LO16 = 50,
R_MIPS_GLOB_DAT = 51,
+ R_MIPS_PC21_S2 = 60,
+ R_MIPS_PC26_S2 = 61,
+ R_MIPS_PC18_S3 = 62,
+ R_MIPS_PC19_S2 = 63,
+ R_MIPS_PCHI16 = 64,
+ R_MIPS_PCLO16 = 65,
R_MIPS16_GOT16 = 102,
R_MIPS16_HI16 = 104,
R_MIPS16_LO16 = 105,
Modified: llvm/trunk/lib/Object/ELF.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/ELF.cpp?rev=209201&r1=209200&r2=209201&view=diff
==============================================================================
--- llvm/trunk/lib/Object/ELF.cpp (original)
+++ llvm/trunk/lib/Object/ELF.cpp Tue May 20 04:27:49 2014
@@ -159,6 +159,15 @@ StringRef getELFRelocationTypeName(uint3
LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_MIPS_TLS_TPREL_HI16);
LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_MIPS_TLS_TPREL_LO16);
LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_MIPS_GLOB_DAT);
+ LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_MIPS_PC21_S2);
+ LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_MIPS_PC26_S2);
+ LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_MIPS_PC18_S3);
+ LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_MIPS_PC19_S2);
+ LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_MIPS_PCHI16);
+ LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_MIPS_PCLO16);
+ LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_MIPS16_GOT16);
+ LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_MIPS16_HI16);
+ LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_MIPS16_LO16);
LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_MIPS_COPY);
LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_MIPS_JUMP_SLOT);
LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_MICROMIPS_26_S1);
@@ -177,6 +186,7 @@ StringRef getELFRelocationTypeName(uint3
LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_MICROMIPS_TLS_TPREL_HI16);
LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_MICROMIPS_TLS_TPREL_LO16);
LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_MIPS_NUM);
+ LLVM_ELF_SWITCH_RELOC_TYPE_NAME(R_MIPS_PC32);
default:
break;
}
Modified: llvm/trunk/lib/Object/ELFYAML.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/ELFYAML.cpp?rev=209201&r1=209200&r2=209201&view=diff
==============================================================================
--- llvm/trunk/lib/Object/ELFYAML.cpp (original)
+++ llvm/trunk/lib/Object/ELFYAML.cpp Tue May 20 04:27:49 2014
@@ -275,6 +275,8 @@ void ScalarBitSetTraits<ELFYAML::ELF_EF>
BCase(EF_MIPS_ARCH_64)
BCase(EF_MIPS_ARCH_32R2)
BCase(EF_MIPS_ARCH_64R2)
+ BCase(EF_MIPS_ARCH_32R6)
+ BCase(EF_MIPS_ARCH_64R6)
break;
case ELF::EM_HEXAGON:
BCase(EF_HEXAGON_MACH_V2)
@@ -462,6 +464,15 @@ void ScalarEnumerationTraits<ELFYAML::EL
ECase(R_MIPS_TLS_TPREL_HI16)
ECase(R_MIPS_TLS_TPREL_LO16)
ECase(R_MIPS_GLOB_DAT)
+ ECase(R_MIPS_PC21_S2)
+ ECase(R_MIPS_PC26_S2)
+ ECase(R_MIPS_PC18_S3)
+ ECase(R_MIPS_PC19_S2)
+ ECase(R_MIPS_PCHI16)
+ ECase(R_MIPS_PCLO16)
+ ECase(R_MIPS16_GOT16)
+ ECase(R_MIPS16_HI16)
+ ECase(R_MIPS16_LO16)
ECase(R_MIPS_COPY)
ECase(R_MIPS_JUMP_SLOT)
ECase(R_MICROMIPS_26_S1)
Modified: llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/ELFDumper.cpp?rev=209201&r1=209200&r2=209201&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/ELFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/ELFDumper.cpp Tue May 20 04:27:49 2014
@@ -455,7 +455,9 @@ static const EnumEntry<unsigned> ElfHead
LLVM_READOBJ_ENUM_ENT(ELF, EF_MIPS_ARCH_32),
LLVM_READOBJ_ENUM_ENT(ELF, EF_MIPS_ARCH_64),
LLVM_READOBJ_ENUM_ENT(ELF, EF_MIPS_ARCH_32R2),
- LLVM_READOBJ_ENUM_ENT(ELF, EF_MIPS_ARCH_64R2)
+ LLVM_READOBJ_ENUM_ENT(ELF, EF_MIPS_ARCH_64R2),
+ LLVM_READOBJ_ENUM_ENT(ELF, EF_MIPS_ARCH_32R6),
+ LLVM_READOBJ_ENUM_ENT(ELF, EF_MIPS_ARCH_64R6)
};
template<class ELFT>
More information about the llvm-commits
mailing list