aboutsummaryrefslogtreecommitdiff
path: root/ELF/Target.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ELF/Target.cpp')
-rw-r--r--ELF/Target.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/ELF/Target.cpp b/ELF/Target.cpp
index cb2b178fa849..55fcf1734d1f 100644
--- a/ELF/Target.cpp
+++ b/ELF/Target.cpp
@@ -356,7 +356,9 @@ X86TargetInfo::X86TargetInfo() {
RelExpr X86TargetInfo::getRelExpr(uint32_t Type, const SymbolBody &S) const {
switch (Type) {
- default:
+ case R_386_16:
+ case R_386_32:
+ case R_386_TLS_LDO_32:
return R_ABS;
case R_386_TLS_GD:
return R_TLSGD;
@@ -381,6 +383,12 @@ RelExpr X86TargetInfo::getRelExpr(uint32_t Type, const SymbolBody &S) const {
return R_TLS;
case R_386_TLS_LE_32:
return R_NEG_TLS;
+ case R_386_NONE:
+ return R_HINT;
+ default:
+ error("do not know how to handle relocation '" + toString(Type) + "' (" +
+ Twine(Type) + ")");
+ return R_HINT;
}
}
@@ -623,7 +631,11 @@ template <class ELFT>
RelExpr X86_64TargetInfo<ELFT>::getRelExpr(uint32_t Type,
const SymbolBody &S) const {
switch (Type) {
- default:
+ case R_X86_64_32:
+ case R_X86_64_32S:
+ case R_X86_64_64:
+ case R_X86_64_DTPOFF32:
+ case R_X86_64_DTPOFF64:
return R_ABS;
case R_X86_64_TPOFF32:
return R_TLS;
@@ -649,6 +661,10 @@ RelExpr X86_64TargetInfo<ELFT>::getRelExpr(uint32_t Type,
return R_GOT_PC;
case R_X86_64_NONE:
return R_HINT;
+ default:
+ error("do not know how to handle relocation '" + toString(Type) + "' (" +
+ Twine(Type) + ")");
+ return R_HINT;
}
}
@@ -870,7 +886,7 @@ void X86_64TargetInfo<ELFT>::relocateOne(uint8_t *Loc, uint32_t Type,
write64le(Loc, Val);
break;
default:
- error(getErrorLocation(Loc) + "unrecognized reloc " + Twine(Type));
+ llvm_unreachable("unexpected relocation");
}
}