[ELF] - Read 16 bits for R_386_16/R_386_PC16 relocations instead of 32.

Looks it was theoretically incorrect if the section is at the very end of the file as
reading 32 bits would pass the end of file

llvm-svn: 289046
This commit is contained in:
George Rimar 2016-12-08 13:50:28 +00:00
parent baffdb8bc2
commit c49fd8c477
1 changed files with 2 additions and 1 deletions

View File

@ -439,12 +439,13 @@ uint64_t X86TargetInfo::getImplicitAddend(const uint8_t *Buf,
default:
return 0;
case R_386_16:
case R_386_PC16:
return read16le(Buf);
case R_386_32:
case R_386_GOT32:
case R_386_GOT32X:
case R_386_GOTOFF:
case R_386_GOTPC:
case R_386_PC16:
case R_386_PC32:
case R_386_PLT32:
case R_386_TLS_LE: