Convert a few assert failures into proper errors.

Fixes PR25944.

llvm-svn: 257697
This commit is contained in:
Rafael Espindola
2016-01-13 22:56:57 +00:00
parent 3dd0ff3b62
commit 8340f94df1
13 changed files with 79 additions and 44 deletions

View File

@@ -129,9 +129,9 @@ class ELFObjectWriter : public MCObjectWriter {
bool hasRelocationAddend() const {
return TargetObjectWriter->hasRelocationAddend();
}
unsigned GetRelocType(const MCValue &Target, const MCFixup &Fixup,
bool IsPCRel) const {
return TargetObjectWriter->GetRelocType(Target, Fixup, IsPCRel);
unsigned getRelocType(MCContext &Ctx, const MCValue &Target,
const MCFixup &Fixup, bool IsPCRel) const {
return TargetObjectWriter->getRelocType(Ctx, Target, Fixup, IsPCRel);
}
void align(unsigned Alignment);
@@ -682,7 +682,7 @@ void ELFObjectWriter::recordRelocation(MCAssembler &Asm,
}
}
unsigned Type = GetRelocType(Target, Fixup, IsPCRel);
unsigned Type = getRelocType(Ctx, Target, Fixup, IsPCRel);
bool RelocateWithSymbol = shouldRelocateWithSymbol(Asm, RefA, SymA, C, Type);
if (!RelocateWithSymbol && SymA && !SymA->isUndefined())
C += Layout.getSymbolOffset(*SymA);