[PATCH] D54868: [PPC][PPC64] PPC_REL14 and PPC64_REL14 relocations

Joel Stanley via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 27 15:32:28 PST 2018


joel added inline comments.


================
Comment at: ELF/Arch/PPC64.cpp:720
                        uint64_t BranchAddr, const Symbol &S) const {
   // The only call relocation we currently support is the REL24 type.
+  if (Type != R_PPC64_REL24 && Type != R_PPC64_REL14)
----------------
This comment is now stale


================
Comment at: ELF/Arch/PPC64.cpp:739
 bool PPC64::inBranchRange(RelType Type, uint64_t Src, uint64_t Dst) const {
-  assert(Type == R_PPC64_REL24 && "Unexpected relocation type used in branch");
+  assert(Type == R_PPC64_REL24 || Type == R_PPC64_REL14 &&
+    "Unexpected relocation type used in branch");
----------------
This introduces a warning:

```
lld/ELF/Arch/PPC64.cpp:739:57: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
   assert(Type == R_PPC64_REL24 || Type == R_PPC64_REL14 &&
                                   ~~~~~~~~~~~~~~~~~~~~~~^~

```


Repository:
  rLLD LLVM Linker

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

https://reviews.llvm.org/D54868





More information about the llvm-commits mailing list