Found this during experiments with refactoring.
Our PltSection code assumes that InX::Iplt section has zero header size
and that InX::Plt always has non-zero header:
https://github.com/llvm-mirror/lld/blob/master/ELF/SyntheticSections.cpp#L1870
But PPC64 target sets PltHeaderSize to zero:
https://github.com/llvm-mirror/lld/blob/master/ELF/Arch/PPC64.cpp#L68
(I could be wrong about reasons, but I think PPC64 target just does not
implement lazy binding).
Because of that, ppc64-toc-restore.s testcase, for example, sets IsInIplt flag for
symbols, what does not seem to be correct.
I suggest to stop using HeaderSize == 0 in code as condition to find out whether
we are in Plt or Iplt section.
That IsIplt is true if it is Iplt is obvious, no? If you change this to something like "true if IPLT. false if the regular PLT", that would be nontrivial. But I doubt we need it though.