[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:41:23 PST 2018


MaskRay added inline comments.


================
Comment at: ELF/InputSection.cpp:968
+      // and return true. Otherwise relocate to the original .toc entry.
+      if (!tryRelaxToc(File, Type, Rel, Expr, BufLoc, AddrLoc))
+        Target->relocateOne(BufLoc, Type, TargetVA);
----------------
They are put here probably because of ARM/AArch64 precedents:  `getAArch64UndefinedRelativeWeakVA` `getARMStaticBase` etc.

If TOC is PPC/PPC64 specific, the static function `tryRelaxToc` and many of its callees may be renamed to include the substring `PPC`.




================
Comment at: ELF/Relocations.h:70
   R_RELAX_GOT_PC_NOPIC,
+  R_RELAX_TOC,
   R_RELAX_TLS_GD_TO_IE,
----------------
If the TOC (Table of Contents) section is PPC/PPC64 specific this should probably be named `R_PPC_RELAX_TOC`. `R_AARCH64_RELAX_TLS_GD_TO_IE_PAGE_PC` is a precedent.




Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D54720





More information about the llvm-commits mailing list