This fixes PR39711: -static -z retpolineplt does not produce retpoline header as IPLT header.
-z now is not relevant.
Statically linked executable does not have PLT, but may have IPLT with no header. When -z retpolineplt is specified, however, the repoline header should still be emitted.
I've checked that this fixes (the program prints "Hi" rather than SIGSEGV) the FreeBSD reproduce in PR39711 and a Linux program linked against glibc.
getPltEntryOffset may look dirty after this patch, but it can be cleaned up later.
This is nontrivial code, which needs a comment.