summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2017-01-25 21:05:17 +0000
committerRui Ueyama <ruiu@google.com>2017-01-25 21:05:17 +0000
commit6ec3b468ddd4448814194091a42e63f026adadeb (patch)
tree599940376fbb3ab06ca09059af71795869082087
parent470f070b7dd208f677193439cdb08438f1cee46a (diff)
downloadbcm5719-llvm-6ec3b468ddd4448814194091a42e63f026adadeb.tar.gz
bcm5719-llvm-6ec3b468ddd4448814194091a42e63f026adadeb.zip
Remove useless cast and update a comment.
llvm-svn: 293089
-rw-r--r--lld/ELF/Target.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp
index b56926a961c..b4f06d5afaf 100644
--- a/lld/ELF/Target.cpp
+++ b/lld/ELF/Target.cpp
@@ -512,17 +512,15 @@ void X86TargetInfo::relocateOne(uint8_t *Loc, uint32_t Type,
uint64_t Val) const {
checkInt<32>(Loc, Val, Type);
- // R_386_PC16/R_386_16/R_386_PC8/R_386_8 are not part of the current i386
- // psABI. They are used by 16-bit x86 objects, like boot loaders.
- if (Type == R_386_8 || Type == R_386_PC8) {
- *Loc = (uint8_t)Val;
- return;
- }
- if (Type == R_386_16 || Type == R_386_PC16) {
+ // R_386_{PC,}{8,16} are not part of the i386 psABI, but they are
+ // being used for some 16-bit programs such as boot loaders, so
+ // we want to support them.
+ if (Type == R_386_8 || Type == R_386_PC8)
+ *Loc = Val;
+ else if (Type == R_386_16 || Type == R_386_PC16)
write16le(Loc, Val);
- return;
- }
- write32le(Loc, Val);
+ else
+ write32le(Loc, Val);
}
void X86TargetInfo::relaxTlsGdToLe(uint8_t *Loc, uint32_t Type,
OpenPOWER on IntegriCloud