[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
Thu Oct 8 12:50:38 PDT 2015


ruiu added a comment.

For ForPltEntry, you can do

  uint64_t Start = Out<ELF64BE>::Plt->getVA();
  uint64_t End = Start + Out<ELF64BE>::Plt->getSize();
  // Address A is pointing an PLT entry if Start <= A && A < End

By using this you can eliminate one parameter. I removed other parameter from the function, which is GotVA.

I don't think there's an obvious way to eliminate BufEnd, so I can live with that. But the parameter should be used only for that PPC relocation type. We don't want to do boundary check in general because Buf is guaranteed to not overrun.


http://reviews.llvm.org/D13565





More information about the llvm-commits mailing list