[lld] r198787 - [Mips] Do not use standard relocation identifier R_MIPS_NONE for
Simon Atanasyan
simon at atanasyan.com
Wed Jan 8 12:42:38 PST 2014
Author: atanasyan
Date: Wed Jan 8 14:42:38 2014
New Revision: 198787
URL: http://llvm.org/viewvc/llvm-project?rev=198787&view=rev
Log:
[Mips] Do not use standard relocation identifier R_MIPS_NONE for
internal purpose. Use special LLD_R_MIPS_GLOBAL_GOT constant for that.
Modified:
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.h
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h
lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.cpp
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.h?rev=198787&r1=198786&r2=198787&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsLinkingContext.h Wed Jan 8 14:42:38 2014
@@ -14,6 +14,12 @@
namespace lld {
namespace elf {
+/// \brief Mips internal references.
+enum {
+ /// \brief Do nothing but mark GOT entry as a global one.
+ LLD_R_MIPS_GLOBAL_GOT = 1024
+};
+
typedef llvm::object::ELFType<llvm::support::little, 2, false> Mips32ElELFType;
template <class ELFType> class MipsTargetLayout;
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp?rev=198787&r1=198786&r2=198787&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationHandler.cpp Wed Jan 8 14:42:38 2014
@@ -177,6 +177,9 @@ error_code MipsTargetRelocationHandler::
case R_MIPS_JALR:
// We do not do JALR optimization now.
break;
+ case LLD_R_MIPS_GLOBAL_GOT:
+ // Do nothing.
+ break;
default: {
std::string str;
llvm::raw_string_ostream s(str);
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp?rev=198787&r1=198786&r2=198787&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsRelocationPass.cpp Wed Jan 8 14:42:38 2014
@@ -138,7 +138,7 @@ private:
if (da)
ga->addReferenceELF_Mips(R_MIPS_32, 0, a, 0);
else
- ga->addReferenceELF_Mips(R_MIPS_NONE, 0, a, 0);
+ ga->addReferenceELF_Mips(LLD_R_MIPS_GLOBAL_GOT, 0, a, 0);
_globalGotVector.push_back(ga);
}
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h?rev=198787&r1=198786&r2=198787&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h Wed Jan 8 14:42:38 2014
@@ -55,7 +55,7 @@ public:
continue;
assert(r->kindArch() == Reference::KindArch::Mips);
if (r->kindValue() == llvm::ELF::R_MIPS_32 ||
- r->kindValue() == llvm::ELF::R_MIPS_NONE) {
+ r->kindValue() == LLD_R_MIPS_GLOBAL_GOT) {
ta = r->target();
break;
}
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.cpp?rev=198787&r1=198786&r2=198787&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsTargetHandler.cpp Wed Jan 8 14:42:38 2014
@@ -180,8 +180,13 @@ void MipsTargetHandler::registerRelocati
}
const Registry::KindStrings MipsTargetHandler::kindStrings[] = {
- LLD_KIND_STRING_ENTRY(R_MIPS_NONE), LLD_KIND_STRING_ENTRY(R_MIPS_32),
- LLD_KIND_STRING_ENTRY(R_MIPS_HI16), LLD_KIND_STRING_ENTRY(R_MIPS_LO16),
- LLD_KIND_STRING_ENTRY(R_MIPS_GOT16), LLD_KIND_STRING_ENTRY(R_MIPS_CALL16),
- LLD_KIND_STRING_ENTRY(R_MIPS_JALR), LLD_KIND_STRING_END
+ LLD_KIND_STRING_ENTRY(R_MIPS_NONE),
+ LLD_KIND_STRING_ENTRY(R_MIPS_32),
+ LLD_KIND_STRING_ENTRY(R_MIPS_HI16),
+ LLD_KIND_STRING_ENTRY(R_MIPS_LO16),
+ LLD_KIND_STRING_ENTRY(R_MIPS_GOT16),
+ LLD_KIND_STRING_ENTRY(R_MIPS_CALL16),
+ LLD_KIND_STRING_ENTRY(R_MIPS_JALR),
+ LLD_KIND_STRING_ENTRY(LLD_R_MIPS_GLOBAL_GOT),
+ LLD_KIND_STRING_END
};
More information about the llvm-commits
mailing list