[PATCH] D13565: [ELF2] Allow PPC64 to add the TOC-restore after .plt-based relocations

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 12 10:40:04 PDT 2015


ruiu added inline comments.

================
Comment at: ELF/Target.cpp:397-400
@@ -394,2 +396,6 @@
   case R_PPC64_REL24: {
+    uint64_t PltStart = Out<ELF64BE>::Plt->getVA();
+    uint64_t PltEnd = PltStart + Out<ELF64BE>::Plt->getSize();
+    bool ForPltEntry = S + A >= PltStart && S + A < PltEnd;
+
     uint32_t Mask = 0x03FFFFFC;
----------------
Move this just above if (ForPltEntry &&, so that it's apparent that the following four lines don't use these variables.

================
Comment at: ELF/Target.cpp:399
@@ +398,3 @@
+    uint64_t PltEnd = PltStart + Out<ELF64BE>::Plt->getSize();
+    bool ForPltEntry = S + A >= PltStart && S + A < PltEnd;
+
----------------
I'd write this like the number line.

  bool InPlt = PltStart <= S + A && S + A  < PltEnd;

================
Comment at: test/elf2/Inputs/shared-ppc64.s:11
@@ +10,2 @@
+        blr
+
----------------
Remove this trailing line.

================
Comment at: test/elf2/ppc64-toc-restore.s:46
@@ +45,2 @@
+// CHECK: 10020020:
+
----------------
Ditto


http://reviews.llvm.org/D13565





More information about the llvm-commits mailing list