[lld] 97b767e - [ELF] Support missing relocations in PPC64::getImplicitAddend()

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 30 10:47:02 PDT 2022


Author: Fangrui Song
Date: 2022-07-30T10:46:58-07:00
New Revision: 97b767eb3ba0ea9bb4a1c8ea95cc14289ab087f2

URL: https://github.com/llvm/llvm-project/commit/97b767eb3ba0ea9bb4a1c8ea95cc14289ab087f2
DIFF: https://github.com/llvm/llvm-project/commit/97b767eb3ba0ea9bb4a1c8ea95cc14289ab087f2.diff

LOG: [ELF] Support missing relocations in PPC64::getImplicitAddend()

Added: 
    

Modified: 
    lld/ELF/Arch/PPC64.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Arch/PPC64.cpp b/lld/ELF/Arch/PPC64.cpp
index 9b72029e8e1d2..f90e89cb8d671 100644
--- a/lld/ELF/Arch/PPC64.cpp
+++ b/lld/ELF/Arch/PPC64.cpp
@@ -1064,11 +1064,18 @@ RelType PPC64::getDynRel(RelType type) const {
 int64_t PPC64::getImplicitAddend(const uint8_t *buf, RelType type) const {
   switch (type) {
   case R_PPC64_NONE:
+  case R_PPC64_GLOB_DAT:
+  case R_PPC64_JMP_SLOT:
     return 0;
   case R_PPC64_REL32:
     return SignExtend64<32>(read32(buf));
   case R_PPC64_ADDR64:
   case R_PPC64_REL64:
+  case R_PPC64_RELATIVE:
+  case R_PPC64_IRELATIVE:
+  case R_PPC64_DTPMOD64:
+  case R_PPC64_DTPREL64:
+  case R_PPC64_TPREL64:
     return read64(buf);
   default:
     internalLinkerError(getErrorLocation(buf),


        


More information about the llvm-commits mailing list