[ELF][test] Add testing for dynamic TLS relocations in .debug_info
authorAndrew Ng <andrew.ng@sony.com>
Thu, 7 Oct 2021 16:57:57 +0000 (17:57 +0100)
committerAndrew Ng <andrew.ng@sony.com>
Tue, 12 Oct 2021 09:54:52 +0000 (10:54 +0100)
Differential Revision: https://reviews.llvm.org/D111436

lld/test/ELF/x86-64-tls-ld-local.s

index 4978b83..53b3120 100644 (file)
@@ -1,7 +1,7 @@
 // REQUIRES: x86
 // RUN: llvm-mc %s -o %t.o -filetype=obj -triple=x86_64-pc-linux
 // RUN: ld.lld %t.o -o %t.so -shared
-// RUN: llvm-readobj -r -S %t.so | FileCheck %s
+// RUN: llvm-readobj -r -S --hex-dump=.debug_info %t.so | FileCheck %s
 
 // CHECK:      Relocations [
 // CHECK-NEXT:   Section ({{.*}}) .rela.dyn {
@@ -13,6 +13,9 @@
 // CHECK-NEXT:   }
 // CHECK-NEXT: ]
 
+// CHECK:      Hex dump of section '.debug_info':
+// CHECK-NEXT: 0x00000000 04000000 00000000 00000000 00000000
+
        data16
        leaq    bar@TLSGD(%rip), %rdi
        data16
@@ -27,3 +30,9 @@
        .section        .tdata,"awT",@progbits
 bar:
        .long   42
+foo:
+       .long   43
+
+       .section        .debug_info,"",@progbits
+       .quad   foo@DTPOFF
+       .quad   bar@DTPOFF