This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 02/10] addr32: Output REX prefix for UNSPEC_GOTNTPOFF
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Richard Henderson <rth at redhat dot com>
- Date: Sun, 4 Mar 2012 23:12:20 +0100
- Subject: Re: [PATCH 02/10] addr32: Output REX prefix for UNSPEC_GOTNTPOFF
- Authentication-results: mr.google.com; spf=pass (google.com: domain of ubizjak@gmail.com designates 10.236.138.110 as permitted sender) smtp.mail=ubizjak@gmail.com; dkim=pass header.i=ubizjak@gmail.com
- References: <20120302203614.GA2179@intel.com>
On Fri, Mar 2, 2012 at 9:36 PM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> X86-64 linker optimizes TLS_MODEL_INITIAL_EXEC to TLS_MODEL_LOCAL_EXEC
> by checking
>
> ? ? ? ?movq foo@gottpoff(%rip), %reg
>
> and
>
> ? ? ? ?addq foo@gottpoff(%rip), %reg
>
> It uses the REX prefix to avoid the last byte of the previous
> instruction. ?With 32bit Pmode, we may not have the REX prefix and
> the last byte of the previous instruction may be an offset, which
> may look like a REX prefix. ?IE->LE optimization will generate corrupted
> binary. ?This patch makes sure we always output an REX pfrefix for
> UNSPEC_GOTNTPOFF. ?OK for trunk?
No, please implement this using UNSPEC in the same way as
tls_initial_exec_64_sun implements Sun linker quirk.
Uros.