X32: Add REX prefix to encode R_X86_64_GOTTPOFF
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 7 Nov 2014 20:22:53 +0000 (12:22 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 7 Nov 2014 20:31:01 +0000 (12:31 -0800)
commitcf115d606eea814d659588953cbaa5b0b16e234c
tree54d26310722578b4ef723553d795c1ec502b8fec
parent35cd712bccbb56c7705eb9cd7372b725da6152b4
X32: Add REX prefix to encode R_X86_64_GOTTPOFF

Structions with R_X86_64_GOTTPOFF relocation must be encoded with REX
prefix even if it isn't required by destination register.  Otherwise
linker can't safely perform IE -> LE optimization.

bfd/

PR ld/17482
* elf64-x86-64.c (elf_x86_64_relocate_section): Update comments
for IE->LE transition.

gas/

PR ld/17482
* config/tc-i386.c (output_insn): Add a dummy REX_OPCODE prefix
for structions with R_X86_64_GOTTPOFF relocation for x32 if needed.

gas/testsuite/

PR ld/17482
* gas/i386/ilp32/x32-tls.d: New file.
* gas/i386/ilp32/x32-tls.s: Likewise.

ld/testsuite/

PR ld/17482
* ld-x86-64/tlsie4.dd: Updated.
bfd/ChangeLog
bfd/elf64-x86-64.c
gas/ChangeLog
gas/config/tc-i386.c
gas/testsuite/ChangeLog
gas/testsuite/gas/i386/ilp32/x32-tls.d [new file with mode: 0644]
gas/testsuite/gas/i386/ilp32/x32-tls.s [new file with mode: 0644]
ld/testsuite/ChangeLog
ld/testsuite/ld-x86-64/tlsie4.dd