[PATCH] D13835: [ELF2] - Implemented R_X86_64_PLT32 rellocation.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 16 16:15:46 PDT 2015


grimar added inline comments.

================
Comment at: ELF/Target.cpp:314-316
@@ -313,2 +313,5 @@
   }
+  case R_X86_64_PLT32:
+    write32le(Loc, SA - BaseAddr - Offset);
+    break;
   default:
----------------
ruiu wrote:
> Your test does not seem to cover this code. (I just run your test without applying this code, and it didn't die with "unrecognized reloc" error defined below, so a relocation with R_x86_64_PLT32 did not reach this function.)
Without applying this code this relocations are handled in another branch and consumed by:
 


void InputSection<ELFT>::relocate(
....
    if (Target->relocNeedsPlt(Type, Body)) {                <--- here
      SymVA = Out<ELFT>::Plt->getEntryAddr(Body);
      Type = Target->getPLTRefReloc(Type);
    } 

but since my case does not need plt then execution moves forward to relocateOne() and fails there without R_X86_64_PLT32 handler.


http://reviews.llvm.org/D13835





More information about the llvm-commits mailing list