This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] x86-64: Treat PC32 relocation with branch as PLT32
- From: Cary Coutant <ccoutant at gmail dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, Binutils <binutils at sourceware dot org>
- Date: Tue, 6 Feb 2018 10:15:45 -0800
- Subject: Re: [PATCH] x86-64: Treat PC32 relocation with branch as PLT32
- Authentication-results: sourceware.org; auth=none
- References: <20180206133536.10841-1-hjl.tools@gmail.com> <ef5667a1-40a7-9f3f-27a7-4487aba3b8e1@redhat.com>
> 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