Skip to content

Commit c49fd8c

Browse files
author
George Rimar
committedDec 8, 2016
[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
1 parent baffdb8 commit c49fd8c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎lld/ELF/Target.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -439,12 +439,13 @@ uint64_t X86TargetInfo::getImplicitAddend(const uint8_t *Buf,
439439
default:
440440
return 0;
441441
case R_386_16:
442+
case R_386_PC16:
443+
return read16le(Buf);
442444
case R_386_32:
443445
case R_386_GOT32:
444446
case R_386_GOT32X:
445447
case R_386_GOTOFF:
446448
case R_386_GOTPC:
447-
case R_386_PC16:
448449
case R_386_PC32:
449450
case R_386_PLT32:
450451
case R_386_TLS_LE:

0 commit comments

Comments
 (0)