diff options
author | Rui Ueyama <ruiu@google.com> | 2016-06-21 23:53:08 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2016-06-21 23:53:08 +0000 |
commit | 39061a5220f520b0f192580159d1c5b6827bb128 (patch) | |
tree | fe2fbaa8a5439cf248f0ff0836949e797ba82d13 | |
parent | 21521891a2e3492f22455af6c1c1a903a723115c (diff) | |
download | bcm5719-llvm-39061a5220f520b0f192580159d1c5b6827bb128.tar.gz bcm5719-llvm-39061a5220f520b0f192580159d1c5b6827bb128.zip |
Simplify writeThunk. NFC.
Previously, `Buf + 4` was written twice.
llvm-svn: 273337
-rw-r--r-- | lld/ELF/Target.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp index bc9cebff47a..163736f50f0 100644 --- a/lld/ELF/Target.cpp +++ b/lld/ELF/Target.cpp @@ -1839,12 +1839,11 @@ void MipsTargetInfo<ELFT>::writeThunk(uint8_t *Buf, uint64_t S) const { // Write MIPS LA25 thunk code to call PIC function from the non-PIC one. // See MipsTargetInfo::writeThunk for details. const endianness E = ELFT::TargetEndianness; - write32<E>(Buf, 0x3c190000); // lui $25, %hi(func) - write32<E>(Buf + 4, 0x08000000); // j func - write32<E>(Buf + 8, 0x27390000); // addiu $25, $25, %lo(func) - write32<E>(Buf + 12, 0x00000000); // nop + write32<E>(Buf, 0x3c190000); // lui $25, %hi(func) + write32<E>(Buf + 4, 0x08000000 | (S >> 2)); // j func + write32<E>(Buf + 8, 0x27390000); // addiu $25, $25, %lo(func) + write32<E>(Buf + 12, 0x00000000); // nop writeMipsHi16<E>(Buf, S); - write32<E>(Buf + 4, 0x08000000 | (S >> 2)); writeMipsLo16<E>(Buf + 8, S); } |