[lld] r274513 - Add a test for accessing __tls_get_addr with a GOT.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 4 10:34:53 PDT 2016
Author: rafael
Date: Mon Jul 4 12:34:53 2016
New Revision: 274513
URL: http://llvm.org/viewvc/llvm-project?rev=274513&view=rev
Log:
Add a test for accessing __tls_get_addr with a GOT.
This was already passing, but missing a test.
Added:
lld/trunk/test/ELF/Inputs/x86-64-tls-gd-got.s
lld/trunk/test/ELF/x86-64-tls-gd-got.s
Added: lld/trunk/test/ELF/Inputs/x86-64-tls-gd-got.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/Inputs/x86-64-tls-gd-got.s?rev=274513&view=auto
==============================================================================
--- lld/trunk/test/ELF/Inputs/x86-64-tls-gd-got.s (added)
+++ lld/trunk/test/ELF/Inputs/x86-64-tls-gd-got.s Mon Jul 4 12:34:53 2016
@@ -0,0 +1,6 @@
+ .globl bar
+ .section .tdata,"awT", at progbits
+ .align 4
+ .type bar, @object
+bar:
+ .long 42
Added: lld/trunk/test/ELF/x86-64-tls-gd-got.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/x86-64-tls-gd-got.s?rev=274513&view=auto
==============================================================================
--- lld/trunk/test/ELF/x86-64-tls-gd-got.s (added)
+++ lld/trunk/test/ELF/x86-64-tls-gd-got.s Mon Jul 4 12:34:53 2016
@@ -0,0 +1,19 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t1.o
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/x86-64-tls-gd-got.s -o %t2.o
+# RUN: ld.lld %t1.o %t2.o -o %t
+# RUN: llvm-objdump -d %t | FileCheck %s
+
+ .globl _start
+_start:
+ .byte 0x66
+ leaq bar at tlsgd(%rip), %rdi
+ .byte 0x66
+ rex64
+ call *__tls_get_addr at GOTPCREL(%rip)
+ ret
+
+// CHECK: _start:
+// CHECK-NEXT: movq %fs:0, %rax
+// CHECK-NEXT: leaq -4(%rax), %rax
+// CHECK-NEXT: retq
More information about the llvm-commits
mailing list