Unconditional generation of PLT32 relocations had been added as an optimization in revision da4f43a4b4987f4b207b3ecee6bf67a9f5761c81.
Here is related commit message:
[llvm-mc] - Produce R_X86_64_PLT32 for "call/jmp foo". For instructions like call foo and jmp foo patch changes relocation produced from R_X86_64_PC32 to R_X86_64_PLT32. Relocation can be used as a marker for 32-bit PC-relative branches. Linker will reduce PLT32 relocation to PC32 if function is defined locally. Differential revision: https://reviews.llvm.org/D43383
The scheme relies on linker support to reduce PLT32 to PC32 relocations back when not needed. It's not always feasible\convenient to rely on that.
This patch introduces an option to be able to disable this optimization if not needed. Off by default.