[PATCH] D111436: [ELF][test] Add testing for dynamic TLS relocations in .debug_info

Andrew Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 8 09:22:50 PDT 2021


andrewng created this revision.
andrewng added a reviewer: MaskRay.
Herald added a subscriber: emaste.
andrewng requested review of this revision.

https://reviews.llvm.org/D111436

Files:
  lld/test/ELF/relocation-dyn-tls-debug-info.s


Index: lld/test/ELF/relocation-dyn-tls-debug-info.s
===================================================================
--- /dev/null
+++ lld/test/ELF/relocation-dyn-tls-debug-info.s
@@ -0,0 +1,33 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
+# RUN: ld.lld -shared %t.o -o %t
+# RUN: llvm-objdump -s --section=.debug_info %t | FileCheck %s
+
+# CHECK:      Contents of section .debug_info:
+# CHECK-NEXT:  0000 08000000 00000000 00000000 00000000
+# CHECK-NEXT:  0010 04000000 00000000
+
+# RUN: ld.lld --gc-sections -shared %t.o -o %t-gc
+# RUN: llvm-objdump -s --section=.debug_info %t-gc | FileCheck --check-prefix=GC %s
+
+# GC:      Contents of section .debug_info:
+# GC-NEXT:  0000 04000000 00000000 00000000 00000000
+# GC-NEXT:  0010 00000000 00000000
+
+## Use SHF_GNU_RETAIN to keep t0 and t2 with --gc-sections.
+.section .tdata.t0,"awTR", at progbits
+t0:
+.long 42
+
+.section .tdata.t1,"awT", at progbits
+t1:
+.long 43
+
+.section .tdata.t2,"awTR", at progbits
+t2:
+.long 44
+
+.section .debug_info,"", at progbits
+.quad t2 at DTPOFF
+.quad t0 at DTPOFF
+.quad t1 at DTPOFF


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111436.378269.patch
Type: text/x-patch
Size: 1111 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211008/e3385aa3/attachment.bin>


More information about the llvm-commits mailing list