[PATCH] D87318: [LLD][PowerPC] Add support for R_PPC64_GOT_TLSGD_PCREL34 used in TLS General Dynamic

Sean Fertile via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 13:14:30 PDT 2020


sfertile added inline comments.


================
Comment at: lld/ELF/Arch/PPC64.cpp:1277
+  case R_PPC64_PCREL34:
+  case R_PPC64_GOT_TLSGD_PCREL34: {
     const uint64_t si0Mask = 0x00000003ffff0000;
----------------
stefanp wrote:
> sfertile wrote:
> > It looks like these 2 cases and `R_PPC64_GOT_PCREL34` et al share the same implementation, we should combine them.
> Initially I wanted to do this after all of the LLD patches were in. However, you are now the second person to ask for this so I'm going do it now.
> I'm going to do this in an NFC patch and then rebase this patch on top.
Thanks.


================
Comment at: lld/ELF/Relocations.cpp:1369
+      // Offset R_PPC64_TLSGD by one byte in the NOTOC case.
+      // Here we check the next relocation to see if it is R_PPC64_REL24_NOTOC.
+      // If the next relocation is a NOTOC then the R_PPC64_TLSGD is part of a
----------------
The first line does a good job explaining what we are doing, the following then somewhat repeats it. I think we can pare this comment down without losing much:

```
// Offset the 4-byte aligned R_PPC64_TLSGD by one byte in the NOTOC case, so we can discern it later from the toc-case.
```




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87318



More information about the llvm-commits mailing list