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

Victor Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 09:56:14 PDT 2020


NeHuang 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;
----------------
nit: please add the comment to elaborate `Relax from ... to ...` for PCRel LD to LE relaxation.


================
Comment at: lld/ELF/Arch/PPC64.cpp:781
+  case R_PPC64_GOT_TLSLD_PCREL34:
+    writePrefixedInstruction(loc, 0x06000000386d1000); // paddi 3, 13, 0x1000
+    break;
----------------
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?


================
Comment at: lld/ELF/Arch/PPC64.cpp:786
+    if (locAsInt % 4 == 0) {
+      write32(loc, NOP);            // NOP
+      write32(loc + 4, 0x38631000); // addi r3, r3, 4096
----------------
nit:  `// nop`


================
Comment at: lld/ELF/Arch/PPC64.cpp:789
+    } else if (locAsInt % 4 == 1)
+      write32(loc - 1, NOP);        // NOP
+    else
----------------
nit: `// nop`


================
Comment at: lld/test/ELF/ppc64-tls-pcrel-ld.s:37
+
+# LDTOLE-RELOC: There are no relocations in this file.
+
----------------
missing relocation for `R_PPC64_TPREL34`?


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