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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 21 13:29:00 PST 2018


MaskRay added inline comments.


================
Comment at: ELF/Arch/PPC64.cpp:267
+          "Expeceted a 'ld' for got-indirect to toc-relative relaxing");
+    Instr &= 0x3FFFFFF;
+    Instr |= 0x38000000;
----------------
Instr &= 0x03FFFFFF;


================
Comment at: ELF/InputSection.cpp:882
+  // through all relocations to find the one with the correct offset.
+  auto Rela = Relas[Offset / 8 /* Toc Entry size */];
+  if (Offset != Rela.r_offset) {
----------------
`Offset / 8 /* Toc Entry size */` -> `Index`


================
Comment at: ELF/InputSection.cpp:895
+  // Can't relax if the target symbol is not defined.
+  return Optional<RelaxTo>();
+}
----------------
Maybe just `return None;`


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D54720





More information about the llvm-commits mailing list