[PATCH] D13566: [ELF2] PPC64 needs to delay local-call relocations until after the function-descriptor values are known

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 12 15:00:01 PDT 2015


ruiu added inline comments.

================
Comment at: ELF/Target.cpp:412
@@ +411,3 @@
+      if (InOpd)
+        R = read64be(&OpdBuf[S + A - OpdStart]);
+    }
----------------
  read64be(OpdBuf + S + A - OpdStart);

================
Comment at: ELF/Target.h:90-91
@@ -89,1 +89,4 @@
+
+  static void *OpdPtr;
+  static uint8_t *OpdBuf;
 };
----------------
No need to make them static. They can be non-static members.

Because PPC64 is ELF64BE, you can use the strict type.

  OutputSection<ELF64BE> *OpdPtr = nullptr;
  static uint8_t *OpdBuf = nullptr;

================
Comment at: ELF/Writer.cpp:479-480
@@ -475,1 +478,4 @@
+  // relocations.
+  PPC64TargetInfo::OpdPtr =
+    Map.lookup({".opd", SHT_PROGBITS, SHF_WRITE | SHF_ALLOC});
 }
----------------
  if (OutputSection<ELFT> *Sec = Map.lookup({".opd", ...))
    Target->Opd = reinterpret_cast<OutputSection<ELF64BE> *>(Sec);


http://reviews.llvm.org/D13566





More information about the llvm-commits mailing list