This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: PR gold/14858: X32 TLS relocations are incorrectly handled


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]