[PATCH] D87504: [PowerPC][LLD] Support for PC Relative TLS for Local Dynamic

Stefan Pintilie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 2 09:09:46 PDT 2020


stefanp added inline comments.


================
Comment at: lld/ELF/Arch/PPC64.cpp:781
+  case R_PPC64_GOT_TLSLD_PCREL34:
+    writePrefixedInstruction(loc, 0x06000000386d1000); // paddi 3, 13, 0x1000
+    break;
----------------
NeHuang wrote:
> NeHuang wrote:
> > nit: please add the comment to elaborate `Relax from ... to ...` for PCRel LD to LE relaxation.
> Do we need to add `, 0x1000` in the comment?
I think we should add the constant. The way that the relaxation works is that we will always be using that same constant in this situation so I figured it should be there. However, I will add the `, 0` at the end so show that we are not using the PC Rel version of the instruction.


================
Comment at: lld/test/ELF/ppc64-tls-pcrel-ld.s:37
+
+# LDTOLE-RELOC: There are no relocations in this file.
+
----------------
NeHuang wrote:
> missing relocation for `R_PPC64_TPREL34`?
I don't believe that this relocation would appear in the final output file. The linker can compute that value and just fill in the instruction.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87504/new/

https://reviews.llvm.org/D87504



More information about the llvm-commits mailing list