bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/14858] X32 TLS relocations are incorrectly handled


From: hjl.tools at gmail dot com
Subject: [Bug gold/14858] X32 TLS relocations are incorrectly handled
Date: Tue, 20 Nov 2012 04:44:19 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=14858

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2012-11-20 04:44:19 
UTC ---
Input relocation is:

00000000 <get_ld>:
   0:    53                       push   %rbx
   1:    48 8d 3d 00 00 00 00     lea    0x0(%rip),%rdi        # 8 <get_ld+0x8>
   4: R_X86_64_TLSLD    tls_ld-0x4
   8:    e8 00 00 00 00           callq  d <get_ld+0xd>    9: R_X86_64_PC32   
__tls_get_addr-0x4
   d:    48 89 c3                 mov    %rax,%rbx
  10:    8b 83 00 00 00 00        mov    0x0(%rbx),%eax    12:
R_X86_64_DTPOFF32    tls_ld
  16:    03 83 00 00 00 00        add    0x0(%rbx),%eax    18:
R_X86_64_DTPOFF32    tls_ld2
  1c:    5b                       pop    %rbx
  1d:    c3                       retq   

Gold output is:

004004d0 <get_ld>:
  4004d0:    53                       push   %rbx
  4004d1:    66 66 66 64 48 8b 04 25 00 00 00 00     data32 data32 data32 mov
%fs:0x0,%rax
  4004dd:    48 89 c3                 mov    %rax,%rbx
  4004e0:    8b 83 fc ff ff ff        mov    -0x4(%rbx),%eax
  4004e6:    03 83 f8 ff ff ff        add    -0x8(%rbx),%eax
  4004ec:    5b                       pop    %rbx
  4004ed:    c3                       retq

The correct one should be:

  4004d0:    53                       push   %rbx
  4004d1:    0f 1f 40 00              nopl   0x0(%rax)
  4004d5:    64 8b 04 25 00 00 00 00     mov    %fs:0x0,%eax
  4004dd:    48 89 c3                 mov    %rax,%rbx
  4004e0:    8b 83 fc ff ff ff        mov    -0x4(%rbx),%eax
  4004e6:    03 83 f8 ff ff ff        add    -0x8(%rbx),%eax
  4004ec:    5b                       pop    %rbx
  4004ed:    c3                       retq

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]