[PATCH] D37335: [MIPS] Initial support of microMIPS code linking

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 6 10:00:58 PDT 2017


ruiu added inline comments.


================
Comment at: ELF/Arch/Mips.cpp:485
+  case R_MICROMIPS_GOT16:
+    if (Config->Relocatable)
+      writeRelocation<E, 16, 16>(Loc, Val + 0x8000);
----------------
ruiu wrote:
> nit: add {}
?


================
Comment at: ELF/Arch/Mips.cpp:239
+    memset(Buf, 0, PltHeaderSize);
+    write16<E>(Buf, isMipsR6<ELFT>() ? 0x7860 : 0x7980);
+                                    // addiupc v1, (GOTPLT) - .
----------------
Add a blank line here so that it is clear that the comment is saying only about the memset.


================
Comment at: ELF/Arch/Mips.cpp:292
+    memset(Buf, 0, PltEntrySize);
+    if (isMipsR6<ELFT>()) {
+      write16<E>(Buf, 0x7840);      // addiupc $2, (GOTPLT) - .
----------------
Ditto


================
Comment at: ELF/Arch/Mips.cpp:517
+    checkInt<16>(Loc, Val, Type);
+    LLVM_FALLTHROUGH;
+  case R_MICROMIPS_CALL16:
----------------
Since the following `case` body is essentially one line, it is probably better to copy code instead of falling through.


Repository:
  rL LLVM

https://reviews.llvm.org/D37335





More information about the llvm-commits mailing list