diff options
author | Jakub Jelinek <jakub@redhat.com> | 2013-08-29 10:25:27 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2013-08-29 10:25:27 +0000 |
commit | 5c98a14e1e4ffe0e8754ca07e50c564e1a22d6c1 (patch) | |
tree | 23692432f3e4612eff5ebb256233f3a179834e94 /ld/testsuite/ld-x86-64/tlspic1.s | |
parent | 5b791bb530cc1023a5e05a5216836bf80d71a6cd (diff) | |
download | fsf-binutils-gdb-5c98a14e1e4ffe0e8754ca07e50c564e1a22d6c1.zip fsf-binutils-gdb-5c98a14e1e4ffe0e8754ca07e50c564e1a22d6c1.tar.gz fsf-binutils-gdb-5c98a14e1e4ffe0e8754ca07e50c564e1a22d6c1.tar.bz2 |
* elf64-x86-64.c (elf_x86_64_check_tls_transition): Allow
64-bit -mcmodel=large -fpic TLS GD and LD sequences.
(elf_x86_64_relocate_section): Handle -mcmodel=large -fpic
TLS GD and LD sequences in GD->LE, GD->IE and LD->LE transitions.
ld/testsuite/
* ld-x86-64/x86-64.exp: Add tlsld3, tlsgd7 and tlsgd8 tests.
* ld-x86-64/tlspic1.s: Add -mcmodel=large -fpic TLS GD and LD
sequences.
* ld-x86-64/tlspic.dd: Adjusted.
* ld-x86-64/tlspic.rd: Adjusted.
* ld-x86-64/tlspic-nacl.rd: Adjusted.
* ld-x86-64/tlsld3.dd: New test.
* ld-x86-64/tlsld3.s: New file.
* ld-x86-64/tlsgd7.dd: New test.
* ld-x86-64/tlsgd7.s: New file.
* ld-x86-64/tlsgd8.dd: New test.
* ld-x86-64/tlsgd8.s: New file.
Diffstat (limited to 'ld/testsuite/ld-x86-64/tlspic1.s')
-rw-r--r-- | ld/testsuite/ld-x86-64/tlspic1.s | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/ld/testsuite/ld-x86-64/tlspic1.s b/ld/testsuite/ld-x86-64/tlspic1.s index 5e26f26..aa18f36 100644 --- a/ld/testsuite/ld-x86-64/tlspic1.s +++ b/ld/testsuite/ld-x86-64/tlspic1.s @@ -183,5 +183,108 @@ fn1: movq %fs:(%rcx), %rdx nop;nop;nop;nop +1: movabsq $_GLOBAL_OFFSET_TABLE_-1b, %r11 + pushq %rbx + pushq %rbx + leaq 1b(%rip), %rbx + addq %r11, %rbx + nop;nop;nop;nop + + /* -mcmodel=large sequences */ + + /* -mcmodel=large GD */ + leaq sg1@tlsgd(%rip), %rdi + movabsq $__tls_get_addr@pltoff, %rax + addq %rbx, %rax + call *%rax + nop;nop;nop;nop + + /* -mcmodel=large GD -> IE because variable is referenced through IE too */ + leaq sg2@tlsgd(%rip), %rdi + movabsq $__tls_get_addr@pltoff, %rax + addq %rbx, %rax + call *%rax + nop;nop;nop;nop + + /* -mcmodel=large GD against local variable */ + leaq sl1@tlsgd(%rip), %rdi + movabsq $__tls_get_addr@pltoff, %rax + addq %rbx, %rax + call *%rax + nop;nop;nop;nop + + /* -mcmodel=large GD -> IE against local variable referenced through IE too */ + leaq sl2@tlsgd(%rip), %rdi + movabsq $__tls_get_addr@pltoff, %rax + addq %rbx, %rax + call *%rax + nop;nop;nop;nop + + /* -mcmodel=large GD against hidden and local variable */ + leaq sh1@tlsgd(%rip), %rdi + movabsq $__tls_get_addr@pltoff, %rax + addq %rbx, %rax + call *%rax + nop;nop;nop;nop + + /* -mcmodel=large GD -> IE against hidden and local variable referenced through + IE too */ + leaq sh2@tlsgd(%rip), %rdi + movabsq $__tls_get_addr@pltoff, %rax + addq %rbx, %rax + call *%rax + nop;nop;nop;nop + + /* -mcmodel=large GD against hidden but not local variable */ + leaq sH1@tlsgd(%rip), %rdi + movabsq $__tls_get_addr@pltoff, %rax + addq %rbx, %rax + call *%rax + nop;nop;nop;nop + + /* -mcmodel=large GD -> IE against hidden but not local variable referenced through + IE too */ + leaq sH2@tlsgd(%rip), %rdi + movabsq $__tls_get_addr@pltoff, %rax + addq %rbx, %rax + call *%rax + nop;nop;nop;nop + + /* -mcmodel=large LD */ + leaq sl1@tlsld(%rip), %rdi + movabsq $__tls_get_addr@pltoff, %rax + addq %rbx, %rax + call *%rax + nop;nop + leaq sl1@dtpoff(%rax), %rdx + nop;nop + leaq 2+sl2@dtpoff(%rax), %r9 + nop;nop;nop;nop + + /* -mcmodel=large LD against hidden and local variables */ + leaq sh1@tlsld(%rip), %rdi + movabsq $__tls_get_addr@pltoff, %rax + addq %rbx, %rax + call *%rax + nop;nop + leaq sh1@dtpoff(%rax), %rdx + nop;nop + leaq sh2@dtpoff+3(%rax), %rcx + nop;nop;nop;nop + + /* -mcmodel=large LD against hidden but not local variables */ + leaq sH1@tlsld(%rip), %rdi + movabsq $__tls_get_addr@pltoff, %rax + addq %rbx, %rax + call *%rax + nop;nop + leaq sH1@dtpoff(%rax), %r12 + nop;nop + leaq sH2@dtpoff+1(%rax), %rcx + nop;nop;nop;nop + + popq %rbx + popq %rbx + leave ret |