[lld] r367877 - [ELF][test] Reorganize some tls-*.s tests

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 5 08:34:01 PDT 2019


Author: maskray
Date: Mon Aug  5 08:34:01 2019
New Revision: 367877

URL: http://llvm.org/viewvc/llvm-project?rev=367877&view=rev
Log:
[ELF][test] Reorganize some tls-*.s tests

Some tls-*.s tests do not test generic TLS behavior but rather are x86 specific.
Rename them to i386-*.s or x86-64-*.s

Delete tls-static.s: covered by tls-opt.s
Delete tls-opt-no-plt.s: add --implicit-check-not=.plt to x86-64-tls-gdie.s to cover it

Rename tls-dynamic-i686.s to i386-tls-dynamic.s
Rename tls-i686.s to i386-tls-le.s
Rename tls-opt-i686.s to i386-tls-opt.s
Rename tls-opt-iele-i686-nopic.s to i386-tls-opt-iele-nopic.s

Rename tls-dynamic.s to x86-64-tls-dynamic.s . IE should be split off in the future.
Rename tls-error.s to x86-64-reloc-tpoff32-error.s
Rename tls-opt-gdie.s to x86-64-tls-gdie.s
Rename tls-opt-x86_64-noplt.s to x86-64-tls-opt-noplt.s
Rename tls-opt-local.s => x86-64-tls-ie-opt-local.s . It can be merged with x86-64-tls-ie-local.s in the future.

Added:
    lld/trunk/test/ELF/i386-tls-dynamic.s
    lld/trunk/test/ELF/i386-tls-gdiele.s
      - copied, changed from r367869, lld/trunk/test/ELF/tls-opt-gdiele-i686.s
    lld/trunk/test/ELF/i386-tls-le.s
    lld/trunk/test/ELF/i386-tls-opt-iele-nopic.s
      - copied, changed from r367869, lld/trunk/test/ELF/tls-opt-iele-i686-nopic.s
    lld/trunk/test/ELF/i386-tls-opt.s
      - copied, changed from r367869, lld/trunk/test/ELF/tls-opt-i686.s
    lld/trunk/test/ELF/x86-64-reloc-tpoff32-error.s
      - copied, changed from r367869, lld/trunk/test/ELF/tls-error.s
    lld/trunk/test/ELF/x86-64-tls-dynamic.s
      - copied, changed from r367869, lld/trunk/test/ELF/tls-dynamic.s
    lld/trunk/test/ELF/x86-64-tls-gdie.s
      - copied, changed from r367869, lld/trunk/test/ELF/tls-opt-gdie.s
    lld/trunk/test/ELF/x86-64-tls-ie-opt-local.s
      - copied, changed from r367869, lld/trunk/test/ELF/tls-opt-local.s
    lld/trunk/test/ELF/x86-64-tls-opt-noplt.s
      - copied, changed from r367869, lld/trunk/test/ELF/tls-opt-x86_64-noplt.s
Removed:
    lld/trunk/test/ELF/tls-dynamic-i686.s
    lld/trunk/test/ELF/tls-dynamic.s
    lld/trunk/test/ELF/tls-error.s
    lld/trunk/test/ELF/tls-i686.s
    lld/trunk/test/ELF/tls-opt-gdie.s
    lld/trunk/test/ELF/tls-opt-gdiele-i686.s
    lld/trunk/test/ELF/tls-opt-i686.s
    lld/trunk/test/ELF/tls-opt-iele-i686-nopic.s
    lld/trunk/test/ELF/tls-opt-local.s
    lld/trunk/test/ELF/tls-opt-no-plt.s
    lld/trunk/test/ELF/tls-opt-x86_64-noplt.s
    lld/trunk/test/ELF/tls-static.s

Added: lld/trunk/test/ELF/i386-tls-dynamic.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/i386-tls-dynamic.s?rev=367877&view=auto
==============================================================================
--- lld/trunk/test/ELF/i386-tls-dynamic.s (added)
+++ lld/trunk/test/ELF/i386-tls-dynamic.s Mon Aug  5 08:34:01 2019
@@ -0,0 +1,100 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=i686 %s -o %t.o
+# RUN: ld.lld -shared %t.o -o %t.so
+# RUN: llvm-readobj --sections -r %t.so | FileCheck %s
+# RUN: llvm-objdump -d --no-show-raw-insn %t.so | FileCheck %s --check-prefix=DIS
+
+.type tls0, at object
+.section .tbss,"awT", at nobits
+.globl tls0
+.align 4
+tls0:
+ .long 0
+ .size tls0, 4
+
+.type  tls1, at object
+.globl tls1
+.align 4
+tls1:
+ .long 0
+ .size tls1, 4
+
+.type  tls2, at object
+.globl tls2
+.hidden tls2
+.align 4
+tls2:
+ .long 0
+ .size tls2, 8
+
+.section .text
+.globl _start
+_start:
+leal tls0 at tlsgd(,%ebx,1),%eax
+call __tls_get_addr at plt
+
+leal tls1 at tlsgd(,%ebx,1),%eax
+call __tls_get_addr at plt
+
+leal tls2 at tlsldm(%ebx),%eax
+call __tls_get_addr at plt
+leal tls2 at dtpoff(%eax),%edx
+
+leal tls2 at tlsldm(%ebx),%eax
+call __tls_get_addr at plt
+leal tls2 at dtpoff+4(%eax),%edx
+
+movl %gs:0,%eax
+addl tls0 at gotntpoff(%ebx),%eax
+
+movl %gs:0,%eax
+addl tls1 at gotntpoff(%ebx),%eax
+
+# CHECK:      Name: .got (
+# CHECK-NEXT: Type: SHT_PROGBITS
+# CHECK-NEXT: Flags [
+# CHECK-NEXT:   SHF_ALLOC
+# CHECK-NEXT:   SHF_WRITE
+# CHECK-NEXT: ]
+# CHECK-NEXT: Address: 0x2078
+# CHECK-NEXT: Offset: 0x2078
+# CHECK-NEXT: Size: 32
+# CHECK-NEXT: Link: 0
+# CHECK-NEXT: Info: 0
+# CHECK-NEXT: AddressAlignment: 4
+# CHECK-NEXT: EntrySize: 0
+
+# CHECK: Relocations [
+# CHECK:      Section ({{.+}}) .rel.dyn {
+# CHECK-NEXT: 0x2088 R_386_TLS_DTPMOD32 - 0x0
+# CHECK-NEXT: 0x2078 R_386_TLS_DTPMOD32 tls0 0x0
+# CHECK-NEXT: 0x207C R_386_TLS_DTPOFF32 tls0 0x0
+# CHECK-NEXT: 0x2090 R_386_TLS_TPOFF tls0 0x0
+# CHECK-NEXT: 0x2080 R_386_TLS_DTPMOD32 tls1 0x0
+# CHECK-NEXT: 0x2084 R_386_TLS_DTPOFF32 tls1 0x0
+# CHECK-NEXT: 0x2094 R_386_TLS_TPOFF tls1 0x0
+# CHECK-NEXT: }
+
+# DIS:      Disassembly of section .text:
+# DIS-EMPTY:
+# DIS-NEXT: _start:
+## General dynamic model:
+## -3976 and -3968 are first and second GOT entries offsets.
+## Each one is a pair of records.
+# DIS-NEXT: 1000:       leal -3976(,%ebx), %eax
+# DIS-NEXT: 1007:       calll 100
+# DIS-NEXT: 100c:       leal -3968(,%ebx), %eax
+# DIS-NEXT: 1013:       calll 88
+## Local dynamic model:
+## -16 is a local module tls index offset.
+# DIS-NEXT: 1018:       leal -3960(%ebx), %eax
+# DIS-NEXT: 101e:       calll 77
+# DIS-NEXT: 1023:       leal 8(%eax), %edx
+# DIS-NEXT: 1029:       leal -3960(%ebx), %eax
+# DIS-NEXT: 102f:       calll 60
+# DIS-NEXT: 1034:       leal 12(%eax), %edx
+## Initial exec model:
+# DIS-NEXT: 103a:       movl %gs:0, %eax
+# DIS-NEXT: 1040:       addl -3952(%ebx), %eax
+# DIS-NEXT: 1046:       movl %gs:0, %eax
+# DIS-NEXT: 104c:       addl -3948(%ebx), %eax

Copied: lld/trunk/test/ELF/i386-tls-gdiele.s (from r367869, lld/trunk/test/ELF/tls-opt-gdiele-i686.s)
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/i386-tls-gdiele.s?p2=lld/trunk/test/ELF/i386-tls-gdiele.s&p1=lld/trunk/test/ELF/tls-opt-gdiele-i686.s&r1=367869&r2=367877&rev=367877&view=diff
==============================================================================
    (empty)

Added: lld/trunk/test/ELF/i386-tls-le.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/i386-tls-le.s?rev=367877&view=auto
==============================================================================
--- lld/trunk/test/ELF/i386-tls-le.s (added)
+++ lld/trunk/test/ELF/i386-tls-le.s Mon Aug  5 08:34:01 2019
@@ -0,0 +1,71 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=i686 %s -o %t.o
+# RUN: ld.lld %t.o -o %t
+# RUN: ld.lld %t.o -shared -o %t.so
+# RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s --check-prefix=DIS
+# RUN: llvm-readobj -r %t | FileCheck %s --check-prefix=RELOC
+# RUN: llvm-objdump -d --no-show-raw-insn %t.so | FileCheck %s --check-prefix=DISSHARED
+# RUN: llvm-readobj -r %t.so | FileCheck %s --check-prefix=RELOCSHARED
+
+.section ".tdata", "awT", @progbits
+.globl var
+.globl var1
+var:
+.long 0
+var1:
+.long 1
+
+.section test, "awx"
+.global _start
+_start:
+ movl $var at tpoff, %edx
+ movl %gs:0, %ecx
+ subl %edx, %eax
+ movl $var1 at tpoff, %edx
+ movl %gs:0, %ecx
+ subl %edx, %eax
+
+ movl %gs:0, %ecx
+ leal var at ntpoff(%ecx), %eax
+ movl %gs:0, %ecx
+ leal var1 at ntpoff+123(%ecx), %eax
+
+# DIS:      Disassembly of section test:
+# DIS-EMPTY:
+# DIS-NEXT: _start:
+# DIS-NEXT: 401000:       movl    $8, %edx
+# DIS-NEXT: 401005:       movl    %gs:0, %ecx
+# DIS-NEXT: 40100c:       subl    %edx, %eax
+# DIS-NEXT: 40100e:       movl    $4, %edx
+# DIS-NEXT: 401013:       movl    %gs:0, %ecx
+# DIS-NEXT: 40101a:       subl    %edx, %eax
+# DIS-NEXT: 40101c:       movl    %gs:0, %ecx
+# DIS-NEXT: 401023:       leal    -8(%ecx), %eax
+# DIS-NEXT: 401029:       movl    %gs:0, %ecx
+# DIS-NEXT: 401030:       leal    119(%ecx), %eax
+
+# RELOC: Relocations [
+# RELOC-NEXT: ]
+
+# DISSHARED: Disassembly of section test:
+# DISSHARED-EMPTY:
+# DISSHARED-NEXT: _start:
+# DISSHARED-NEXT: 1000:       movl    $0, %edx
+# DISSHARED-NEXT: 1005:       movl    %gs:0, %ecx
+# DISSHARED-NEXT: 100c:       subl    %edx, %eax
+# DISSHARED-NEXT: 100e:       movl    $0, %edx
+# DISSHARED-NEXT: 1013:       movl    %gs:0, %ecx
+# DISSHARED-NEXT: 101a:       subl    %edx, %eax
+# DISSHARED-NEXT: 101c:       movl    %gs:0, %ecx
+# DISSHARED-NEXT: 1023:       leal    (%ecx), %eax
+# DISSHARED-NEXT: 1029:       movl    %gs:0, %ecx
+# DISSHARED-NEXT: 1030:       leal    123(%ecx), %eax
+
+# RELOCSHARED:      Relocations [
+# RELOCSHARED-NEXT: Section (5) .rel.dyn {
+# RELOCSHARED-NEXT:   0x1001 R_386_TLS_TPOFF32 var 0x0
+# RELOCSHARED-NEXT:   0x1025 R_386_TLS_TPOFF var 0x0
+# RELOCSHARED-NEXT:   0x100F R_386_TLS_TPOFF32 var1 0x0
+# RELOCSHARED-NEXT:   0x1032 R_386_TLS_TPOFF var1 0x0
+# RELOCSHARED-NEXT:  }
+# RELOCSHARED-NEXT: ]

Copied: lld/trunk/test/ELF/i386-tls-opt-iele-nopic.s (from r367869, lld/trunk/test/ELF/tls-opt-iele-i686-nopic.s)
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/i386-tls-opt-iele-nopic.s?p2=lld/trunk/test/ELF/i386-tls-opt-iele-nopic.s&p1=lld/trunk/test/ELF/tls-opt-iele-i686-nopic.s&r1=367869&r2=367877&rev=367877&view=diff
==============================================================================
    (empty)

Copied: lld/trunk/test/ELF/i386-tls-opt.s (from r367869, lld/trunk/test/ELF/tls-opt-i686.s)
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/i386-tls-opt.s?p2=lld/trunk/test/ELF/i386-tls-opt.s&p1=lld/trunk/test/ELF/tls-opt-i686.s&r1=367869&r2=367877&rev=367877&view=diff
==============================================================================
    (empty)

Removed: lld/trunk/test/ELF/tls-dynamic-i686.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/tls-dynamic-i686.s?rev=367876&view=auto
==============================================================================
--- lld/trunk/test/ELF/tls-dynamic-i686.s (original)
+++ lld/trunk/test/ELF/tls-dynamic-i686.s (removed)
@@ -1,100 +0,0 @@
-// REQUIRES: x86
-// RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %s -o %t
-// RUN: ld.lld --hash-style=sysv -shared -z norelro %t -o %tout
-// RUN: llvm-readobj --sections -r %tout | FileCheck %s
-// RUN: llvm-objdump -d %tout | FileCheck %s --check-prefix=DIS
-
-.type tls0, at object
-.section .tbss,"awT", at nobits
-.globl tls0
-.align 4
-tls0:
- .long 0
- .size tls0, 4
-
-.type  tls1, at object
-.globl tls1
-.align 4
-tls1:
- .long 0
- .size tls1, 4
-
-.type  tls2, at object
-.globl tls2
-.hidden tls2
-.align 4
-tls2:
- .long 0
- .size tls2, 8
-
-.section .text
-.globl _start
-_start:
-leal tls0 at tlsgd(,%ebx,1),%eax
-call __tls_get_addr at plt
-
-leal tls1 at tlsgd(,%ebx,1),%eax
-call __tls_get_addr at plt
-
-leal tls2 at tlsldm(%ebx),%eax
-call __tls_get_addr at plt
-leal tls2 at dtpoff(%eax),%edx
-
-leal tls2 at tlsldm(%ebx),%eax
-call __tls_get_addr at plt
-leal tls2 at dtpoff+4(%eax),%edx
-
-movl %gs:0,%eax
-addl tls0 at gotntpoff(%ebx),%eax
-
-movl %gs:0,%eax
-addl tls1 at gotntpoff(%ebx),%eax
-
-// CHECK:      Name: .got (
-// CHECK-NEXT: Type: SHT_PROGBITS
-// CHECK-NEXT: Flags [
-// CHECK-NEXT:   SHF_ALLOC
-// CHECK-NEXT:   SHF_WRITE
-// CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x2070
-// CHECK-NEXT: Offset: 0x2070
-// CHECK-NEXT: Size: 32
-// CHECK-NEXT: Link: 0
-// CHECK-NEXT: Info: 0
-// CHECK-NEXT: AddressAlignment: 4
-// CHECK-NEXT: EntrySize: 0
-
-// CHECK: Relocations [
-// CHECK:      Section ({{.+}}) .rel.dyn {
-// CHECK-NEXT: 0x2080 R_386_TLS_DTPMOD32 - 0x0
-// CHECK-NEXT: 0x2070 R_386_TLS_DTPMOD32 tls0 0x0
-// CHECK-NEXT: 0x2074 R_386_TLS_DTPOFF32 tls0 0x0
-// CHECK-NEXT: 0x2088 R_386_TLS_TPOFF tls0 0x0
-// CHECK-NEXT: 0x2078 R_386_TLS_DTPMOD32 tls1 0x0
-// CHECK-NEXT: 0x207C R_386_TLS_DTPOFF32 tls1 0x0
-// CHECK-NEXT: 0x208C R_386_TLS_TPOFF tls1 0x0
-// CHECK-NEXT: }
-
-// DIS:      Disassembly of section .text:
-// DIS-EMPTY:
-// DIS-NEXT: _start:
-// General dynamic model:
-// -32 and -24 are first and second GOT entries offsets.
-// Each one is a pair of records.
-// DIS-NEXT: 1000: {{.*}} leal -32(,%ebx), %eax
-// DIS-NEXT: 1007: {{.*}} calll 100
-// DIS-NEXT: 100c: {{.*}} leal -24(,%ebx), %eax
-// DIS-NEXT: 1013: {{.*}} calll 88
-// Local dynamic model:
-// -16 is a local module tls index offset.
-// DIS-NEXT: 1018: {{.*}} leal -16(%ebx), %eax
-// DIS-NEXT: 101e: {{.*}} calll 77
-// DIS-NEXT: 1023: {{.*}} leal 8(%eax), %edx
-// DIS-NEXT: 1029: {{.*}} leal -16(%ebx), %eax
-// DIS-NEXT: 102f: {{.*}} calll 60
-// DIS-NEXT: 1034: {{.*}} leal 12(%eax), %edx
-// Initial exec model:
-// DIS-NEXT: 103a: {{.*}} movl %gs:0, %eax
-// DIS-NEXT: 1040: {{.*}} addl -8(%ebx), %eax
-// DIS-NEXT: 1046: {{.*}} movl %gs:0, %eax
-// DIS-NEXT: 104c: {{.*}} addl -4(%ebx), %eax

Removed: lld/trunk/test/ELF/tls-dynamic.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/tls-dynamic.s?rev=367876&view=auto
==============================================================================
--- lld/trunk/test/ELF/tls-dynamic.s (original)
+++ lld/trunk/test/ELF/tls-dynamic.s (removed)
@@ -1,88 +0,0 @@
-// REQUIRES: x86
-// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
-// RUN: ld.lld --hash-style=sysv -shared %t -o %tout
-// RUN: llvm-readobj --sections -r %tout | FileCheck %s
-// RUN: llvm-objdump -d %tout | FileCheck %s --check-prefix=DIS
-
-  leaq  a at tlsld(%rip), %rdi
-  callq __tls_get_addr at PLT
-  leaq  b at tlsld(%rip), %rdi
-  callq __tls_get_addr at PLT
-  leaq  a at dtpoff(%rax), %rcx
-  leaq  b at dtpoff(%rax), %rcx
-  .long b at dtpoff, 0
-  leaq  c at tlsgd(%rip), %rdi
-  rex64
-  callq __tls_get_addr at PLT
-  leaq  a at dtpoff(%rax), %rcx
-  // Initial Exec Model Code Sequence, II
-  movq c at gottpoff(%rip),%rax
-  movq %fs:(%rax),%rax
-  movabs $a at dtpoff, %rax
-  movabs $b at dtpoff, %rax
-  movabs $a at dtpoff, %rax
-
-  .global a
-  .hidden a
-  .section .tbss,"awT", at nobits
-  .align 4
-a:
-  .long 0
-
-  .section .tbss,"awT", at nobits
-  .align 4
-b:
-  .long 0
-  .global c
-  .section .tbss,"awT", at nobits
-  .align 4
-c:
-  .long 0
-
-// Get the address of the got, and check that it has 4 entries.
-
-// CHECK:      Sections [
-// CHECK:          Name: .got (
-// CHECK-NEXT:     Type: SHT_PROGBITS
-// CHECK-NEXT:     Flags [
-// CHECK-NEXT:       SHF_ALLOC
-// CHECK-NEXT:       SHF_WRITE
-// CHECK-NEXT:     ]
-// CHECK-NEXT:     Address: 0x20E0
-// CHECK-NEXT:     Offset:
-// CHECK-NEXT:     Size: 40
-
-// CHECK:      Relocations [
-// CHECK:        Section ({{.+}}) .rela.dyn {
-// CHECK-NEXT:     0x20E0 R_X86_64_DTPMOD64 - 0x0
-// CHECK-NEXT:     0x20F0 R_X86_64_DTPMOD64 c 0x0
-// CHECK-NEXT:     0x20F8 R_X86_64_DTPOFF64 c 0x0
-// CHECK-NEXT:     0x2100 R_X86_64_TPOFF64 c 0x0
-// CHECK-NEXT:   }
-
-// 4313 = (0x20E0 + -4) - (0x1000 + 3) // PC relative offset to got entry.
-// 4301 = (0x20F0 + -4) - (0x100c + 3) // PC relative offset to got entry.
-// 4283 = (0x20F8 + -4) - (0x102e + 3) // PC relative offset to got entry.
-// 4279 = (0x2100 + -4) - (0x1042 + 3) // PC relative offset to got entry.
-
-// DIS:      Disassembly of section .text:
-// DIS-EMPTY:
-// DIS-NEXT: .text:
-// DIS-NEXT:     1000: {{.+}} leaq    4313(%rip), %rdi
-// DIS-NEXT:     1007: {{.+}} callq
-// DIS-NEXT:     100c: {{.+}} leaq    4301(%rip), %rdi
-// DIS-NEXT:     1013: {{.+}} callq
-// DIS-NEXT:     1018: {{.+}} leaq    (%rax), %rcx
-// DIS-NEXT:     101f: {{.+}} leaq    4(%rax), %rcx
-// DIS-NEXT:     1026: 04 00
-// DIS-NEXT:     1028: 00 00
-// DIS-NEXT:     102a: 00 00
-// DIS-NEXT:     102c: 00 00
-// DIS-NEXT:     102e: {{.+}} leaq    4283(%rip), %rdi
-// DIS-NEXT:     1035: {{.+}} callq
-// DIS-NEXT:     103b: {{.+}} leaq    (%rax), %rcx
-// DIS-NEXT:     1042: {{.+}} movq    4279(%rip), %rax
-// DIS-NEXT:     1049: {{.+}} movq    %fs:(%rax), %rax
-// DIS-NEXT:     104d: {{.+}} movabsq $0, %rax
-// DIS-NEXT:     1057: {{.+}} movabsq $4, %rax
-// DIS-NEXT:     1061: {{.+}} movabsq $0, %rax

Removed: lld/trunk/test/ELF/tls-error.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/tls-error.s?rev=367876&view=auto
==============================================================================
--- lld/trunk/test/ELF/tls-error.s (original)
+++ lld/trunk/test/ELF/tls-error.s (removed)
@@ -1,12 +0,0 @@
-// REQUIRES: x86
-// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
-// RUN: not ld.lld %t -o /dev/null 2>&1 | FileCheck %s
-// CHECK: R_X86_64_TPOFF32 out of range
-
-.global _start
-_start:
-        movl %fs:a at tpoff, %eax
-.global a
-.section        .tbss,"awT", at nobits
-a:
-.zero 0x80000001

Removed: lld/trunk/test/ELF/tls-i686.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/tls-i686.s?rev=367876&view=auto
==============================================================================
--- lld/trunk/test/ELF/tls-i686.s (original)
+++ lld/trunk/test/ELF/tls-i686.s (removed)
@@ -1,71 +0,0 @@
-// REQUIRES: x86
-// RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %s -o %t
-// RUN: ld.lld %t -o %tout
-// RUN: ld.lld --hash-style=sysv %t -shared -o %tsharedout
-// RUN: llvm-objdump -d %tout | FileCheck %s --check-prefix=DIS
-// RUN: llvm-readobj -r %tout | FileCheck %s --check-prefix=RELOC
-// RUN: llvm-objdump -d %tsharedout | FileCheck %s --check-prefix=DISSHARED
-// RUN: llvm-readobj -r %tsharedout | FileCheck %s --check-prefix=RELOCSHARED
-
-.section ".tdata", "awT", @progbits
-.globl var
-.globl var1
-var:
-.long 0
-var1:
-.long 1
-
-.section test, "awx"
-.global _start
-_start:
- movl $var at tpoff, %edx
- movl %gs:0, %ecx
- subl %edx, %eax
- movl $var1 at tpoff, %edx
- movl %gs:0, %ecx
- subl %edx, %eax
-
- movl %gs:0, %ecx
- leal var at ntpoff(%ecx), %eax
- movl %gs:0, %ecx
- leal var1 at ntpoff+123(%ecx), %eax
-
-// DIS:      Disassembly of section test:
-// DIS-EMPTY:
-// DIS-NEXT: _start:
-// DIS-NEXT: 401000: ba 08 00 00 00       movl $8, %edx
-// DIS-NEXT: 401005: 65 8b 0d 00 00 00 00 movl %gs:0, %ecx
-// DIS-NEXT: 40100c: 29 d0                subl %edx, %eax
-// DIS-NEXT: 40100e: ba 04 00 00 00       movl $4, %edx
-// DIS-NEXT: 401013: 65 8b 0d 00 00 00 00 movl %gs:0, %ecx
-// DIS-NEXT: 40101a: 29 d0                subl %edx, %eax
-// DIS-NEXT: 40101c: 65 8b 0d 00 00 00 00 movl %gs:0, %ecx
-// DIS-NEXT: 401023: 8d 81 f8 ff ff ff    leal -8(%ecx), %eax
-// DIS-NEXT: 401029: 65 8b 0d 00 00 00 00 movl %gs:0, %ecx
-// DIS-NEXT: 401030: 8d 81 77 00 00 00    leal 119(%ecx), %eax
-
-// RELOC: Relocations [
-// RELOC-NEXT: ]
-
-// DISSHARED: Disassembly of section test:
-// DISSHARED-EMPTY:
-// DISSHARED-NEXT: _start:
-// DISSHARED-NEXT: 1000: ba 00 00 00 00 movl   $0, %edx
-// DISSHARED-NEXT: 1005: 65 8b 0d 00 00 00 00  movl %gs:0, %ecx
-// DISSHARED-NEXT: 100c: 29 d0 subl            %edx, %eax
-// DISSHARED-NEXT: 100e: ba 00 00 00 00        movl $0, %edx
-// DISSHARED-NEXT: 1013: 65 8b 0d 00 00 00 00  movl %gs:0, %ecx
-// DISSHARED-NEXT: 101a: 29 d0 subl            %edx, %eax
-// DISSHARED-NEXT: 101c: 65 8b 0d 00 00 00 00  movl %gs:0, %ecx
-// DISSHARED-NEXT: 1023: 8d 81 00 00 00 00     leal (%ecx), %eax
-// DISSHARED-NEXT: 1029: 65 8b 0d 00 00 00 00  movl %gs:0, %ecx
-// DISSHARED-NEXT: 1030: 8d 81 7b 00 00 00     leal 123(%ecx), %eax
-
-// RELOCSHARED:      Relocations [
-// RELOCSHARED-NEXT: Section (4) .rel.dyn {
-// RELOCSHARED-NEXT:   0x1001 R_386_TLS_TPOFF32 var 0x0
-// RELOCSHARED-NEXT:   0x1025 R_386_TLS_TPOFF var 0x0
-// RELOCSHARED-NEXT:   0x100F R_386_TLS_TPOFF32 var1 0x0
-// RELOCSHARED-NEXT:   0x1032 R_386_TLS_TPOFF var1 0x0
-// RELOCSHARED-NEXT:  }
-// RELOCSHARED-NEXT: ]

Removed: lld/trunk/test/ELF/tls-opt-gdie.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/tls-opt-gdie.s?rev=367876&view=auto
==============================================================================
--- lld/trunk/test/ELF/tls-opt-gdie.s (original)
+++ lld/trunk/test/ELF/tls-opt-gdie.s (removed)
@@ -1,54 +0,0 @@
-// REQUIRES: x86
-// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
-// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/tls-opt-gdie.s -o %tso.o
-// RUN: ld.lld -shared %tso.o -o %t.so
-// RUN: ld.lld --hash-style=sysv %t.o %t.so -o %t1
-// RUN: llvm-readobj -S -r %t1 | FileCheck --check-prefix=RELOC %s
-// RUN: llvm-objdump -d %t1 | FileCheck --check-prefix=DISASM %s
-
-//RELOC:      Section {
-//RELOC:      Index:
-//RELOC:      Name: .got
-//RELOC-NEXT: Type: SHT_PROGBITS
-//RELOC-NEXT: Flags [
-//RELOC-NEXT:   SHF_ALLOC
-//RELOC-NEXT:   SHF_WRITE
-//RELOC-NEXT: ]
-//RELOC-NEXT: Address: 0x2020B0
-//RELOC-NEXT: Offset: 0x20B0
-//RELOC-NEXT: Size: 16
-//RELOC-NEXT: Link: 0
-//RELOC-NEXT: Info: 0
-//RELOC-NEXT: AddressAlignment: 8
-//RELOC-NEXT: EntrySize: 0
-//RELOC-NEXT: }
-//RELOC:      Relocations [
-//RELOC-NEXT:   Section (4) .rela.dyn {
-//RELOC-NEXT:     0x2020B0 R_X86_64_TPOFF64 tlsshared0 0x0
-//RELOC-NEXT:     0x2020B8 R_X86_64_TPOFF64 tlsshared1 0x0
-//RELOC-NEXT:   }
-//RELOC-NEXT: ]
-
-//0x201009 + (4256 + 7) = 0x2020B0
-//0x201019 + (4248 + 7) = 0x2020B8
-// DISASM:      Disassembly of section .text:
-// DISASM-EMPTY:
-// DISASM-NEXT: _start:
-// DISASM-NEXT: 201000: {{.*}} movq %fs:0, %rax
-// DISASM-NEXT: 201009: {{.*}} addq 4256(%rip), %rax
-// DISASM-NEXT: 201010: {{.*}} movq %fs:0, %rax
-// DISASM-NEXT: 201019: {{.*}} addq 4248(%rip), %rax
-
-.section .text
-.globl _start
-_start:
- .byte 0x66
- leaq tlsshared0 at tlsgd(%rip),%rdi
- .word 0x6666
- rex64
- call __tls_get_addr at plt
- .byte 0x66
- leaq tlsshared1 at tlsgd(%rip),%rdi
- .word 0x6666
- rex64
- call __tls_get_addr at plt

Removed: lld/trunk/test/ELF/tls-opt-gdiele-i686.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/tls-opt-gdiele-i686.s?rev=367876&view=auto
==============================================================================
--- lld/trunk/test/ELF/tls-opt-gdiele-i686.s (original)
+++ lld/trunk/test/ELF/tls-opt-gdiele-i686.s (removed)
@@ -1,61 +0,0 @@
-// REQUIRES: x86
-// RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %p/Inputs/tls-opt-gdiele-i686.s -o %tso.o
-// RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %s -o %t.o
-// RUN: ld.lld -shared %tso.o -o %tso
-// RUN: ld.lld --hash-style=sysv %t.o %tso -o %tout
-// RUN: llvm-readobj -r %tout | FileCheck --check-prefix=NORELOC %s
-// RUN: llvm-objdump -d %tout | FileCheck --check-prefix=DISASM %s
-
-// NORELOC:      Relocations [
-// NORELOC-NEXT: Section ({{.*}}) .rel.dyn {
-// NORELOC-NEXT:   0x402058 R_386_TLS_TPOFF tlsshared0 0x0
-// NORELOC-NEXT:   0x40205C R_386_TLS_TPOFF tlsshared1 0x0
-// NORELOC-NEXT:   }
-// NORELOC-NEXT: ]
-
-// DISASM:      Disassembly of section .text:
-// DISASM-EMPTY:
-// DISASM-NEXT: _start:
-// DISASM-NEXT: 401000: 65 a1 00 00 00 00 movl %gs:0, %eax
-// DISASM-NEXT: 401006: 03 83 58 f0 ff ff addl -4008(%ebx), %eax
-// DISASM-NEXT: 40100c: 65 a1 00 00 00 00 movl %gs:0, %eax
-// DISASM-NEXT: 401012: 03 83 5c f0 ff ff addl -4004(%ebx), %eax
-// DISASM-NEXT: 401018: 65 a1 00 00 00 00 movl %gs:0, %eax
-// DISASM-NEXT: 40101e: 81 e8 08 00 00 00 subl $8, %eax
-// DISASM-NEXT: 401024: 65 a1 00 00 00 00 movl %gs:0, %eax
-// DISASM-NEXT: 40102a: 81 e8 04 00 00 00 subl $4, %eax
-
-.type tlsexe1, at object
-.section .tbss,"awT", at nobits
-.globl tlsexe1
-.align 4
-tlsexe1:
- .long 0
- .size tlsexe1, 4
-
-.type tlsexe2, at object
-.section .tbss,"awT", at nobits
-.globl tlsexe2
-.align 4
-tlsexe2:
- .long 0
- .size tlsexe2, 4
-
-.section .text
-.globl ___tls_get_addr
-.type ___tls_get_addr, at function
-___tls_get_addr:
-
-.section .text
-.globl _start
-_start:
-//GD->IE
-leal tlsshared0 at tlsgd(,%ebx,1),%eax
-call ___tls_get_addr at plt
-leal tlsshared1 at tlsgd(,%ebx,1),%eax
-call ___tls_get_addr at plt
-//GD->LE
-leal tlsexe1 at tlsgd(,%ebx,1),%eax
-call ___tls_get_addr at plt
-leal tlsexe2 at tlsgd(,%ebx,1),%eax
-call ___tls_get_addr at plt

Removed: lld/trunk/test/ELF/tls-opt-i686.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/tls-opt-i686.s?rev=367876&view=auto
==============================================================================
--- lld/trunk/test/ELF/tls-opt-i686.s (original)
+++ lld/trunk/test/ELF/tls-opt-i686.s (removed)
@@ -1,71 +0,0 @@
-// REQUIRES: x86
-// RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %s -o %t.o
-// RUN: ld.lld %t.o -o %t1
-// RUN: llvm-readobj -r %t1 | FileCheck --check-prefix=NORELOC %s
-// RUN: llvm-objdump -d %t1 | FileCheck --check-prefix=DISASM %s
-
-// NORELOC:      Relocations [
-// NORELOC-NEXT: ]
-
-// DISASM:      Disassembly of section .text:
-// DISASM-EMPTY:
-// DISASM-NEXT: _start:
-// LD -> LE:
-// DISASM-NEXT: 401000: 65 a1 00 00 00 00 movl %gs:0, %eax
-// DISASM-NEXT: 401006: 90                nop
-// DISASM-NEXT: 401007: 8d 74 26 00       leal (%esi,%eiz), %esi
-// DISASM-NEXT: 40100b: 8d 90 f8 ff ff ff leal -8(%eax), %edx
-// DISASM-NEXT: 401011: 65 a1 00 00 00 00 movl %gs:0, %eax
-// DISASM-NEXT: 401017: 90                nop
-// DISASM-NEXT: 401018: 8d 74 26 00       leal (%esi,%eiz), %esi
-// DISASM-NEXT: 40101c: 8d 90 fc ff ff ff leal -4(%eax), %edx
-// IE -> LE:
-// 4294967288 == 0xFFFFFFF8
-// 4294967292 == 0xFFFFFFFC
-// DISASM-NEXT: 401022: 65 a1 00 00 00 00  movl %gs:0, %eax
-// DISASM-NEXT: 401028: c7 c0 f8 ff ff ff  movl $4294967288, %eax
-// DISASM-NEXT: 40102e: 65 a1 00 00 00 00  movl %gs:0, %eax
-// DISASM-NEXT: 401034: c7 c0 fc ff ff ff  movl $4294967292, %eax
-// DISASM-NEXT: 40103a: 65 a1 00 00 00 00  movl %gs:0, %eax
-// DISASM-NEXT: 401040: 8d 80 f8 ff ff ff  leal -8(%eax), %eax
-// DISASM-NEXT: 401046: 65 a1 00 00 00 00  movl %gs:0, %eax
-// DISASM-NEXT: 40104c: 8d 80 fc ff ff ff  leal -4(%eax), %eax
-.type tls0, at object
-.section .tbss,"awT", at nobits
-.globl tls0
-.align 4
-tls0:
- .long 0
- .size tls0, 4
-
-.type  tls1, at object
-.globl tls1
-.align 4
-tls1:
- .long 0
- .size tls1, 4
-
-.section .text
-.globl ___tls_get_addr
-.type ___tls_get_addr, at function
-___tls_get_addr:
-
-.section .text
-.globl _start
-_start:
-//LD -> LE:
-leal tls0 at tlsldm(%ebx),%eax
-call ___tls_get_addr at plt
-leal tls0 at dtpoff(%eax),%edx
-leal tls1 at tlsldm(%ebx),%eax
-call ___tls_get_addr at plt
-leal tls1 at dtpoff(%eax),%edx
-//IE -> LE:
-movl %gs:0,%eax
-movl tls0 at gotntpoff(%ebx),%eax
-movl %gs:0,%eax
-movl tls1 at gotntpoff(%ebx),%eax
-movl %gs:0,%eax
-addl tls0 at gotntpoff(%ebx),%eax
-movl %gs:0,%eax
-addl tls1 at gotntpoff(%ebx),%eax

Removed: lld/trunk/test/ELF/tls-opt-iele-i686-nopic.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/tls-opt-iele-i686-nopic.s?rev=367876&view=auto
==============================================================================
--- lld/trunk/test/ELF/tls-opt-iele-i686-nopic.s (original)
+++ lld/trunk/test/ELF/tls-opt-iele-i686-nopic.s (removed)
@@ -1,102 +0,0 @@
-// REQUIRES: x86
-// RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %s -o %t.o
-// RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %p/Inputs/tls-opt-iele-i686-nopic.s -o %tso.o
-// RUN: ld.lld -shared %tso.o -o %tso
-// RUN: ld.lld --hash-style=sysv %t.o %tso -o %t1
-// RUN: llvm-readobj -S -r %t1 | FileCheck --check-prefix=GOTREL %s
-// RUN: llvm-objdump -d %t1 | FileCheck --check-prefix=DISASM %s
-
-// GOTREL:      Section {
-// GOTREL:        Index:
-// GOTREL:        Name: .got
-// GOTREL-NEXT:   Type: SHT_PROGBITS
-// GOTREL-NEXT:   Flags [
-// GOTREL-NEXT:     SHF_ALLOC
-// GOTREL-NEXT:     SHF_WRITE
-// GOTREL-NEXT:   ]
-// GOTREL-NEXT:   Address:  0x402060
-// GOTREL-NEXT:   Offset: 0x2060
-// GOTREL-NEXT:   Size: 8
-// GOTREL-NEXT:   Link: 0
-// GOTREL-NEXT:   Info: 0
-// GOTREL-NEXT:   AddressAlignment: 4
-// GOTREL-NEXT:   EntrySize: 0
-// GOTREL-NEXT: }
-// GOTREL:      Relocations [
-// GOTREL-NEXT: Section ({{.*}}) .rel.dyn {
-// GOTREL-NEXT:   0x402060 R_386_TLS_TPOFF tlsshared0 0x0
-// GOTREL-NEXT:   0x402064 R_386_TLS_TPOFF tlsshared1 0x0
-// GOTREL-NEXT:  }
-// GOTREL-NEXT: ]
-
-// DISASM:      Disassembly of section .text:
-// DISASM-EMPTY:
-// DISASM-NEXT: _start:
-// 4294967288 = 0xFFFFFFF8
-// 4294967292 = 0xFFFFFFFC
-// 4202592 = (.got)[0] = 0x402060
-// 4202596 = (.got)[1] = 0x402064
-// DISASM-NEXT: 401000: {{.*}} movl $4294967288, %ecx
-// DISASM-NEXT: 401006: {{.*}} movl %gs:(%ecx), %eax
-// DISASM-NEXT: 401009: {{.*}} movl $4294967288, %eax
-// DISASM-NEXT: 40100e: {{.*}} movl %gs:(%eax), %eax
-// DISASM-NEXT: 401011: {{.*}} addl $4294967288, %ecx
-// DISASM-NEXT: 401017: {{.*}} movl %gs:(%ecx), %eax
-// DISASM-NEXT: 40101a: {{.*}} movl $4294967292, %ecx
-// DISASM-NEXT: 401020: {{.*}} movl %gs:(%ecx), %eax
-// DISASM-NEXT: 401023: {{.*}} movl $4294967292, %eax
-// DISASM-NEXT: 401028: {{.*}} movl %gs:(%eax), %eax
-// DISASM-NEXT: 40102b: {{.*}} addl $4294967292, %ecx
-// DISASM-NEXT: 401031: {{.*}} movl %gs:(%ecx), %eax
-// DISASM-NEXT: 401034: {{.*}} movl 4202592, %ecx
-// DISASM-NEXT: 40103a: {{.*}} movl %gs:(%ecx), %eax
-// DISASM-NEXT: 40103d: {{.*}} addl 4202596, %ecx
-// DISASM-NEXT: 401043: {{.*}} movl %gs:(%ecx), %eax
-
-.type tlslocal0, at object
-.section .tbss,"awT", at nobits
-.globl tlslocal0
-.align 4
-tlslocal0:
- .long 0
- .size tlslocal0, 4
-
-.type tlslocal1, at object
-.section .tbss,"awT", at nobits
-.globl tlslocal1
-.align 4
-tlslocal1:
- .long 0
- .size tlslocal1, 4
-
-.section .text
-.globl ___tls_get_addr
-.type ___tls_get_addr, at function
-___tls_get_addr:
-
-.section .text
-.globl _start
-_start:
-movl tlslocal0 at indntpoff,%ecx
-movl %gs:(%ecx),%eax
-
-movl tlslocal0 at indntpoff,%eax
-movl %gs:(%eax),%eax
-
-addl tlslocal0 at indntpoff,%ecx
-movl %gs:(%ecx),%eax
-
-movl tlslocal1 at indntpoff,%ecx
-movl %gs:(%ecx),%eax
-
-movl tlslocal1 at indntpoff,%eax
-movl %gs:(%eax),%eax
-
-addl tlslocal1 at indntpoff,%ecx
-movl %gs:(%ecx),%eax
-
-movl tlsshared0 at indntpoff,%ecx
-movl %gs:(%ecx),%eax
-
-addl tlsshared1 at indntpoff,%ecx
-movl %gs:(%ecx),%eax

Removed: lld/trunk/test/ELF/tls-opt-local.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/tls-opt-local.s?rev=367876&view=auto
==============================================================================
--- lld/trunk/test/ELF/tls-opt-local.s (original)
+++ lld/trunk/test/ELF/tls-opt-local.s (removed)
@@ -1,54 +0,0 @@
-// REQUIRES: x86
-// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
-// RUN: ld.lld %t.o -o %t1
-// RUN: llvm-readobj -r %t1 | FileCheck --check-prefix=NORELOC %s
-// RUN: llvm-objdump -d %t1 | FileCheck --check-prefix=DISASM %s
-
-// NORELOC:      Relocations [
-// NORELOC-NEXT: ]
-
-// DISASM:      Disassembly of section .text:
-// DISASM-EMPTY:
-// DISASM-NEXT: _start:
-// DISASM-NEXT: 201000: 48 c7 c0 f8 ff ff ff movq $-8, %rax
-// DISASM-NEXT: 201007: 49 c7 c7 f8 ff ff ff movq $-8, %r15
-// DISASM-NEXT: 20100e: 48 8d 80 f8 ff ff ff leaq -8(%rax), %rax
-// DISASM-NEXT: 201015: 4d 8d bf f8 ff ff ff leaq -8(%r15), %r15
-// DISASM-NEXT: 20101c: 48 81 c4 f8 ff ff ff addq $-8, %rsp
-// DISASM-NEXT: 201023: 49 81 c4 f8 ff ff ff addq $-8, %r12
-// DISASM-NEXT: 20102a: 48 c7 c0 fc ff ff ff movq $-4, %rax
-// DISASM-NEXT: 201031: 49 c7 c7 fc ff ff ff movq $-4, %r15
-// DISASM-NEXT: 201038: 48 8d 80 fc ff ff ff leaq -4(%rax), %rax
-// DISASM-NEXT: 20103f: 4d 8d bf fc ff ff ff leaq -4(%r15), %r15
-// DISASM-NEXT: 201046: 48 81 c4 fc ff ff ff addq $-4, %rsp
-// DISASM-NEXT: 20104d: 49 81 c4 fc ff ff ff addq $-4, %r12
-
-.section .tbss,"awT", at nobits
-
-.type tls0, at object
-.align 4
-tls0:
- .long 0
- .size tls0, 4
-
-.type  tls1, at object
-.align 4
-tls1:
- .long 0
- .size tls1, 4
-
-.section .text
-.globl _start
-_start:
- movq tls0 at GOTTPOFF(%rip), %rax
- movq tls0 at GOTTPOFF(%rip), %r15
- addq tls0 at GOTTPOFF(%rip), %rax
- addq tls0 at GOTTPOFF(%rip), %r15
- addq tls0 at GOTTPOFF(%rip), %rsp
- addq tls0 at GOTTPOFF(%rip), %r12
- movq tls1 at GOTTPOFF(%rip), %rax
- movq tls1 at GOTTPOFF(%rip), %r15
- addq tls1 at GOTTPOFF(%rip), %rax
- addq tls1 at GOTTPOFF(%rip), %r15
- addq tls1 at GOTTPOFF(%rip), %rsp
- addq tls1 at GOTTPOFF(%rip), %r12

Removed: lld/trunk/test/ELF/tls-opt-no-plt.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/tls-opt-no-plt.s?rev=367876&view=auto
==============================================================================
--- lld/trunk/test/ELF/tls-opt-no-plt.s (original)
+++ lld/trunk/test/ELF/tls-opt-no-plt.s (removed)
@@ -1,35 +0,0 @@
-// REQUIRES: x86
-// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
-// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/tls-opt-gdie.s -o %t2.o
-// RUN: ld.lld %t2.o -o %t2.so -shared
-// RUN: ld.lld %t.o %t2.so -o %t.exe
-// RUN: llvm-readobj -S %t.exe | FileCheck %s
-
-// CHECK-NOT: .plt
-
-        .global _start
-_start:
-        data16
-        leaq    foo at TLSGD(%rip), %rdi
-        data16
-        data16
-        rex64
-        callq   __tls_get_addr at PLT
-
-        leaq    bar at TLSLD(%rip), %rdi
-        callq   __tls_get_addr at PLT
-        leaq    bar at DTPOFF(%rax), %rax
-
-        .type   bar, at object
-        .section        .tdata,"awT", at progbits
-        .align  8
-bar:
-        .long   42
-
-
-        .type   foo, at object
-        .section        .tdata,"awT", at progbits
-        .globl  foo
-        .align  8
-foo:
-        .long   42

Removed: lld/trunk/test/ELF/tls-opt-x86_64-noplt.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/tls-opt-x86_64-noplt.s?rev=367876&view=auto
==============================================================================
--- lld/trunk/test/ELF/tls-opt-x86_64-noplt.s (original)
+++ lld/trunk/test/ELF/tls-opt-x86_64-noplt.s (removed)
@@ -1,88 +0,0 @@
-// REQUIRES: x86
-
-// Checks whether the TLS optimizations match the cases in Chapter 11 of
-// https://raw.githubusercontent.com/wiki/hjl-tools/x86-psABI/x86-64-psABI-1.0.pdf
-
-// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
-// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/tls-opt-gdie.s -o %tso.o
-// RUN: ld.lld -shared %tso.o -o %t.so
-// RUN: ld.lld %t.o %t.so -o %t1
-// RUN: llvm-readobj -r %t1 | FileCheck --check-prefix=RELOC %s
-// RUN: llvm-objdump -d %t1 | FileCheck --check-prefix=DISASM %s
-
-// RELOC:      Relocations [
-// RELOC-NEXT:  Section {{.*}} .rela.dyn {
-// RELOC-NEXT:    0x2020C0 R_X86_64_TPOFF64 tlsshared0 0x0
-// RELOC-NEXT:    0x2020C8 R_X86_64_TPOFF64 tlsshared1 0x0
-// RELOC-NEXT:  }
-// RELOC-NEXT: ]
-
-// DISASM:      _start:
-
-// Table 11.5: GD -> IE Code Transition (LP64)
-// DISASM-NEXT: 201000: 64 48 8b 04 25 00 00 00 00      movq %fs:0, %rax
-// DISASM-NEXT: 201009: 48 03 05 b0 10 00 00            addq 4272(%rip), %rax
-// DISASM-NEXT: 201010: 64 48 8b 04 25 00 00 00 00      movq %fs:0, %rax
-// DISASM-NEXT: 201019: 48 03 05 a8 10 00 00            addq 4264(%rip), %rax
-
-// Table 11.7: GD -> LE Code Transition (LP64)
-// DISASM-NEXT: 201020: 64 48 8b 04 25 00 00 00 00      movq %fs:0, %rax
-// DISASM-NEXT: 201029: 48 8d 80 f8 ff ff ff            leaq -8(%rax), %rax
-// DISASM-NEXT: 201030: 64 48 8b 04 25 00 00 00 00      movq %fs:0, %rax
-// DISASM-NEXT: 201039: 48 8d 80 fc ff ff ff            leaq -4(%rax), %rax
-
-
-// Table 11.9: LD -> LE Code Transition (LP64)
-// DISASM-NEXT: 201040: 66 66 66 66 64 48 8b 04 25 00 00 00 00  movq %fs:0, %rax
-// DISASM-NEXT: 20104d: 66 66 66 66 64 48 8b 04 25 00 00 00 00  movq %fs:0, %rax
-
-.type tls0, at object
-.section .tbss,"awT", at nobits
-.globl tls0
-.align 4
-tls0:
- .long 0
- .size tls0, 4
-
-.type  tls1, at object
-.globl tls1
-.align 4
-tls1:
- .long 0
- .size tls1, 4
-
-.section .text
-.globl _start
-_start:
- // Table 11.5: GD -> IE Code Transition (LP64)
- .byte  0x66
- leaq   tlsshared0 at tlsgd(%rip),%rdi
- .byte  0x66
- rex64
- call   *__tls_get_addr at GOTPCREL(%rip)
-
- .byte  0x66
- leaq   tlsshared1 at tlsgd(%rip),%rdi
- .byte  0x66
- rex64
- call   *__tls_get_addr at GOTPCREL(%rip)
-
- // Table 11.7: GD -> LE Code Transition (LP64)
- .byte  0x66
- leaq   tls0 at tlsgd(%rip),%rdi
- .byte  0x66
- rex64
- call   *__tls_get_addr at GOTPCREL(%rip)
-
- .byte  0x66
- leaq   tls1 at tlsgd(%rip),%rdi
- .byte  0x66
- rex64
- call   *__tls_get_addr at GOTPCREL(%rip)
-
- // Table 11.9: LD -> LE Code Transition (LP64)
- leaq   tls0 at tlsld(%rip),%rdi
- call   *__tls_get_addr at GOTPCREL(%rip)
-
- leaq   tls1 at tlsld(%rip),%rdi
- call   *__tls_get_addr at GOTPCREL(%rip)

Removed: lld/trunk/test/ELF/tls-static.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/tls-static.s?rev=367876&view=auto
==============================================================================
--- lld/trunk/test/ELF/tls-static.s (original)
+++ lld/trunk/test/ELF/tls-static.s (removed)
@@ -1,21 +0,0 @@
-// REQUIRES: x86
-// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t
-// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %S/Inputs/shared.s -o %tso
-// RUN: ld.lld -static %t -o %tout
-// RUN: ld.lld %t -o %tout
-// RUN: ld.lld -shared %tso -o %tshared
-
-.global _start
-_start:
-  data16
-  leaq  foobar at TLSGD(%rip), %rdi
-  data16
-  data16
-  rex64
-  callq  __tls_get_addr at PLT
-
-
-.section        .tdata,"awT", at progbits
-.global  foobar
-foobar:
-  .long   42

Copied: lld/trunk/test/ELF/x86-64-reloc-tpoff32-error.s (from r367869, lld/trunk/test/ELF/tls-error.s)
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/x86-64-reloc-tpoff32-error.s?p2=lld/trunk/test/ELF/x86-64-reloc-tpoff32-error.s&p1=lld/trunk/test/ELF/tls-error.s&r1=367869&r2=367877&rev=367877&view=diff
==============================================================================
--- lld/trunk/test/ELF/tls-error.s (original)
+++ lld/trunk/test/ELF/x86-64-reloc-tpoff32-error.s Mon Aug  5 08:34:01 2019
@@ -1,5 +1,5 @@
 // REQUIRES: x86
-// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
+// RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t
 // RUN: not ld.lld %t -o /dev/null 2>&1 | FileCheck %s
 // CHECK: R_X86_64_TPOFF32 out of range
 

Copied: lld/trunk/test/ELF/x86-64-tls-dynamic.s (from r367869, lld/trunk/test/ELF/tls-dynamic.s)
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/x86-64-tls-dynamic.s?p2=lld/trunk/test/ELF/x86-64-tls-dynamic.s&p1=lld/trunk/test/ELF/tls-dynamic.s&r1=367869&r2=367877&rev=367877&view=diff
==============================================================================
    (empty)

Copied: lld/trunk/test/ELF/x86-64-tls-gdie.s (from r367869, lld/trunk/test/ELF/tls-opt-gdie.s)
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/x86-64-tls-gdie.s?p2=lld/trunk/test/ELF/x86-64-tls-gdie.s&p1=lld/trunk/test/ELF/tls-opt-gdie.s&r1=367869&r2=367877&rev=367877&view=diff
==============================================================================
--- lld/trunk/test/ELF/tls-opt-gdie.s (original)
+++ lld/trunk/test/ELF/x86-64-tls-gdie.s Mon Aug  5 08:34:01 2019
@@ -3,25 +3,12 @@
 // RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/tls-opt-gdie.s -o %tso.o
 // RUN: ld.lld -shared %tso.o -o %t.so
 // RUN: ld.lld --hash-style=sysv %t.o %t.so -o %t1
-// RUN: llvm-readobj -S -r %t1 | FileCheck --check-prefix=RELOC %s
+// RUN: llvm-readobj -S %t1 | FileCheck --check-prefix=SEC --implicit-check-not=.plt %s
+// RUN: llvm-readobj -r %t1 | FileCheck --check-prefix=RELOC %s
 // RUN: llvm-objdump -d %t1 | FileCheck --check-prefix=DISASM %s
 
-//RELOC:      Section {
-//RELOC:      Index:
-//RELOC:      Name: .got
-//RELOC-NEXT: Type: SHT_PROGBITS
-//RELOC-NEXT: Flags [
-//RELOC-NEXT:   SHF_ALLOC
-//RELOC-NEXT:   SHF_WRITE
-//RELOC-NEXT: ]
-//RELOC-NEXT: Address: 0x2020B0
-//RELOC-NEXT: Offset: 0x20B0
-//RELOC-NEXT: Size: 16
-//RELOC-NEXT: Link: 0
-//RELOC-NEXT: Info: 0
-//RELOC-NEXT: AddressAlignment: 8
-//RELOC-NEXT: EntrySize: 0
-//RELOC-NEXT: }
+// SEC .got PROGBITS 00000000002020b0 0020b0 000010 00 WA 0 0 8
+
 //RELOC:      Relocations [
 //RELOC-NEXT:   Section (4) .rela.dyn {
 //RELOC-NEXT:     0x2020B0 R_X86_64_TPOFF64 tlsshared0 0x0

Copied: lld/trunk/test/ELF/x86-64-tls-ie-opt-local.s (from r367869, lld/trunk/test/ELF/tls-opt-local.s)
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/x86-64-tls-ie-opt-local.s?p2=lld/trunk/test/ELF/x86-64-tls-ie-opt-local.s&p1=lld/trunk/test/ELF/tls-opt-local.s&r1=367869&r2=367877&rev=367877&view=diff
==============================================================================
    (empty)

Copied: lld/trunk/test/ELF/x86-64-tls-opt-noplt.s (from r367869, lld/trunk/test/ELF/tls-opt-x86_64-noplt.s)
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/x86-64-tls-opt-noplt.s?p2=lld/trunk/test/ELF/x86-64-tls-opt-noplt.s&p1=lld/trunk/test/ELF/tls-opt-x86_64-noplt.s&r1=367869&r2=367877&rev=367877&view=diff
==============================================================================
    (empty)




More information about the llvm-commits mailing list