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",@progbits +t0: +.long 42 + +.section .tdata.t1,"awT",@progbits +t1: +.long 43 + +.section .tdata.t2,"awTR",@progbits +t2: +.long 44 + +.section .debug_info,"",@progbits +.quad t2@DTPOFF +.quad t0@DTPOFF +.quad t1@DTPOFF