[PATCH] D54720: [PPC64] toc-indirect to toc-relative relaxation.

Zaara Syeda via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 20 06:47:41 PST 2018


syzaara added inline comments.


================
Comment at: ELF/Arch/PPC64.cpp:264
+    uint32_t Instr = readInstrFromHalf16(Loc);
+    if (getPrimaryOpCode(Instr) != 58)
+      llvm_unreachable(
----------------
Instead of 58, we can use the enum DFormOpcd which has LD defined to 58.


================
Comment at: ELF/Arch/PPC64.cpp:266
+      llvm_unreachable(
+          "Expeceted a 'ld' for got-indirect to toc-relative relaxing");
+    Instr &= 0x3FFFFFF;
----------------
Expeceted -> Expected


================
Comment at: ELF/InputSection.cpp:872
+  // Check that the Offset maps to a valid relocation.
+  size_t Index = Offset / /* Toc Entry size */ 8;
+  if (Index >= Relas.size()) {
----------------
Maybe use Target->GotEntrySize instead of 8.


================
Comment at: ELF/InputSection.cpp:879
+
+  // Map the offset to an entry in the .toc. The entires are expected to be in
+  // ascending order, with one for each .toc entry so we don't have to search
----------------
entires -> entries


================
Comment at: ELF/InputSection.cpp:966
+    case R_RELAX_TOC:
+      // If the relocation is relaxable tryTocRelax will perform the relxation
+      // and return true. Otherwise relocate to the original .toc entry.
----------------
relxation -> relaxation


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D54720





More information about the llvm-commits mailing list