[PATCH] D17610: [ELF][MIPS] Calculate combined addend for R_MIPS_GOT16 against local symbol

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 25 11:11:18 PST 2016


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

This seems to be yet another oddity of the MIPS ABI, but the code LGTM.


================
Comment at: ELF/InputSection.cpp:256
@@ +255,3 @@
+          if (LowLoc)
+            AHL += SignExtend64<16>(read32<E>(LowLoc) & 0xffff);
+          SymVA = Out<ELFT>::Got->getMipsLocalPageAddr(SymVA + AHL);
----------------
You can remove 0xffff, no? In SignExtend64<16>(X), only the least significant 16 bits in X matters, I think.


Repository:
  rL LLVM

http://reviews.llvm.org/D17610





More information about the llvm-commits mailing list