This is initial patch to support MIPS64 object files linking. The patch just makes some classes more generalized, and rejects attempts to interlinking O32 and N64 ABI object files. I try to reuse the current MIPS target related classes as much as possible because O32 and N64 MIPS ABI are tightly related and share almost the same set of relocations, GOT, flags etc. llvm-svn: 227058
35 lines
1.1 KiB
C++
35 lines
1.1 KiB
C++
//===- lib/ReaderWriter/ELF/Mips/MipsTargetHandler.cpp --------------------===//
|
|
//
|
|
// The LLVM Linker
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "MipsTargetHandler.h"
|
|
|
|
using namespace lld;
|
|
using namespace elf;
|
|
|
|
void MipsRelocationStringTable::registerTable(Registry ®istry) {
|
|
registry.addKindTable(Reference::KindNamespace::ELF,
|
|
Reference::KindArch::Mips, kindStrings);
|
|
}
|
|
|
|
#define ELF_RELOC(name, value) LLD_KIND_STRING_ENTRY(name),
|
|
|
|
const Registry::KindStrings MipsRelocationStringTable::kindStrings[] = {
|
|
#include "llvm/Support/ELFRelocs/Mips.def"
|
|
LLD_KIND_STRING_ENTRY(LLD_R_MIPS_GLOBAL_GOT),
|
|
LLD_KIND_STRING_ENTRY(LLD_R_MIPS_32_HI16),
|
|
LLD_KIND_STRING_ENTRY(LLD_R_MIPS_GLOBAL_26),
|
|
LLD_KIND_STRING_ENTRY(LLD_R_MIPS_HI16),
|
|
LLD_KIND_STRING_ENTRY(LLD_R_MIPS_LO16),
|
|
LLD_KIND_STRING_ENTRY(LLD_R_MIPS_STO_PLT),
|
|
LLD_KIND_STRING_ENTRY(LLD_R_MICROMIPS_GLOBAL_26_S1),
|
|
LLD_KIND_STRING_END
|
|
};
|
|
|
|
#undef ELF_RELOC
|