forked from OSchip/llvm-project
[Mips] Do not use standard relocation identifier R_MIPS_NONE for
internal purpose. Use special LLD_R_MIPS_GLOBAL_GOT constant for that. llvm-svn: 198787
This commit is contained in:
parent
fc2e4e6a76
commit
50cf77bc2f
|
@ -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;
|
||||
|
|
|
@ -177,6 +177,9 @@ error_code MipsTargetRelocationHandler::applyRelocation(
|
|||
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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -180,8 +180,13 @@ void MipsTargetHandler::registerRelocationNames(Registry ®istry) {
|
|||
}
|
||||
|
||||
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
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue