Implement R_X86_64_16.

It is used by qemu.

llvm-svn: 294965
This commit is contained in:
Rafael Espindola
2017-02-13 16:21:34 +00:00
parent a62b8ce323
commit d6e9ef7e21
4 changed files with 25 additions and 0 deletions

View File

@@ -650,6 +650,7 @@ RelExpr X86_64TargetInfo<ELFT>::getRelExpr(uint32_t Type,
const SymbolBody &S) const {
switch (Type) {
case R_X86_64_8:
case R_X86_64_16:
case R_X86_64_32:
case R_X86_64_32S:
case R_X86_64_64:
@@ -879,6 +880,10 @@ void X86_64TargetInfo<ELFT>::relocateOne(uint8_t *Loc, uint32_t Type,
checkUInt<8>(Loc, Val, Type);
*Loc = Val;
break;
case R_X86_64_16:
checkUInt<16>(Loc, Val, Type);
write16le(Loc, Val);
break;
case R_X86_64_32:
checkUInt<32>(Loc, Val, Type);
write32le(Loc, Val);