summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Rimar <grimar@accesssoftek.com>2016-12-08 13:50:28 +0000
committerGeorge Rimar <grimar@accesssoftek.com>2016-12-08 13:50:28 +0000
commitc49fd8c47791572c142af48ac10c9e6bb486c03f (patch)
tree18eecd3775f846795f476cabffeb406f6def7dd0
parentbaffdb8bc28e870de0810c4517a1ade1f4cc6390 (diff)
downloadbcm5719-llvm-c49fd8c47791572c142af48ac10c9e6bb486c03f.tar.gz
bcm5719-llvm-c49fd8c47791572c142af48ac10c9e6bb486c03f.zip
[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
-rw-r--r--lld/ELF/Target.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp
index 9f743d4a2d5..285dac77354 100644
--- a/lld/ELF/Target.cpp
+++ b/lld/ELF/Target.cpp
@@ -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:
OpenPOWER on IntegriCloud