This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR gold/14858: X32 TLS relocations are incorrectly handled
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: binutils at sourceware dot org, hjl dot tools at gmail dot com
- Date: Mon, 19 Nov 2012 21:58:50 -0800
- Subject: Re: PATCH: PR gold/14858: X32 TLS relocations are incorrectly handled
- References: <20121120044920.GA25156@gmail.com> <m3r4no3k0f.fsf@pepe.airs.com>
On Mon, Nov 19, 2012 at 9:45 PM, Ian Lance Taylor <ian@airs.com> wrote:
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>
>> BTW, we can use
>>
>> memcpy(view - 3, "\x66\x66\x66\x64\x48\x8b\x04\x25\0\0\0", 12);
>>
>> instead of
>>
>> memcpy(view - 3, "\x66\x66\x66\x64\x48\x8b\x04\x25\0\0\0\0", 12);
>>
>> since there is a nul terminator at the end of string. But my patch
>> leaves it alone.
>
> It doesn't matter, GCC should take care of it anyhow.
>
>
>> 2012-11-19 H.J. Lu <hongjiu.lu@intel.com>
>>
>> PR gold/14858
>> * x86_64.cc (Relocate::tls_ld_to_le): Support x32.
>
>> + // For SIZE == 64:
>> // ... leq foo@dtpoff(%rax),%reg
>> // ==> .word 0x6666; .byte 0x66; movq %fs:0,%rax ... leaq x@tpoff(%rax),%rdx
>> + // For SIZE == 32:
>> + // ... leq foo@dtpoff(%rax),%reg
>> + // ==> nopl 0x0(%rax); movq %fs:0,%eax ... leaq x@tpoff(%rax),%rdx
>
> Do you mean movq %rax or do you mean movl %eax? Please correct.
I mean "movl %fs:0,%eax" since pointer is 32-bit in x32.
> This is OK with that change.
>
Checked into trunk and 2.23.
Thanks.
--
H.J.