[PATCH] x86-64: Treat PC32 relocation with branch as PLT32

Cary Coutant ccoutant@gmail.com
Tue Feb 6 18:15:00 GMT 2018


> How is this safe, considering that R_X86_64_PC32 is also used for jump
> tables and the like?

Agreed.

If it's a branch instruction that could be treated as PLT32, the
compiler should emit a PLT32 reloc. We already reduce PLT32 to PC32 in
the linker when the symbol is fully resolved, so the effect is the
same, but without the danger of accidentally changing a non-branch.

-cary



More information about the Binutils mailing list