1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

Explicit symbols for gnu mimicing relocations. Patch by Jack Carter

llvm-svn: 145911
This commit is contained in:
Bruno Cardoso Lopes 2011-12-06 03:34:42 +00:00
parent 4638d36bd2
commit 379e4c7a14
2 changed files with 20 additions and 0 deletions

View File

@ -1831,6 +1831,20 @@ void MipsELFObjectWriter::WriteEFlags() {
ELF::EF_MIPS_ARCH_32R2);
}
const MCSymbol *MipsELFObjectWriter::ExplicitRelSym(const MCAssembler &Asm,
const MCValue &Target,
const MCFragment &F,
const MCFixup &Fixup,
bool IsPCRel) const {
assert(Target.getSymA() && "SymA cannot be 0.");
const MCSymbol &Sym = Target.getSymA()->getSymbol();
if (Sym.getSection().getKind().isMergeable1ByteCString())
return &Sym;
return NULL;
}
unsigned MipsELFObjectWriter::GetRelocType(const MCValue &Target,
const MCFixup &Fixup,
bool IsPCRel,

View File

@ -445,6 +445,12 @@ class ELFObjectWriter : public MCObjectWriter {
virtual void WriteEFlags();
protected:
virtual const MCSymbol *ExplicitRelSym(const MCAssembler &Asm,
const MCValue &Target,
const MCFragment &F,
const MCFixup &Fixup,
bool IsPCRel) const;
virtual unsigned GetRelocType(const MCValue &Target, const MCFixup &Fixup,
bool IsPCRel, bool IsRelocWithSymbol,
int64_t Addend);