xref: /llvm-project-15.0.7/lld/test/ELF/linkerscript/compress-debug-sections.s (revision d6d640eb)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# REQUIRES: x86, zlib
2
3# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux \
4# RUN:   %S/Inputs/compress-debug-sections.s -o %t1.o
5# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t2.o
6
7## .debug_str section is mergeable. LLD would combine all of them into single
8## mergeable synthetic section. We use -O0 here to disable merging, that
9## allows to check that input sections has correctly assigned offsets.
10
11# RUN: echo "SECTIONS { }" > %t.script
12# RUN: ld.lld -O0 %t1.o %t2.o %t.script -o %t1 --compress-debug-sections=zlib
13# RUN: llvm-dwarfdump -a %t1 | FileCheck %s
14# RUN: llvm-readobj -S %t1 | FileCheck %s --check-prefix=ZLIBFLAGS
15
16# RUN: echo "SECTIONS { .debug_str 0 : { *(.debug_str) } }" > %t2.script
17# RUN: ld.lld -O0 %t1.o %t2.o %t2.script -o %t2 --compress-debug-sections=zlib
18# RUN: llvm-dwarfdump -a %t2 | FileCheck %s
19# RUN: llvm-readobj -S %t2 | FileCheck %s --check-prefix=ZLIBFLAGS
20
21# CHECK:       .debug_str contents:
22# CHECK-NEXT:    CCC
23# CHECK-NEXT:    DDD
24# CHECK-NEXT:    AAA
25# CHECK-NEXT:    BBB
26
27# ZLIBFLAGS:       Section {
28# ZLIBFLAGS:         Index:
29# ZLIBFLAGS:         Name: .debug_str
30# ZLIBFLAGS-NEXT:    Type: SHT_PROGBITS
31# ZLIBFLAGS-NEXT:    Flags [
32# ZLIBFLAGS-NEXT:      SHF_COMPRESSED
33
34.section .debug_str,"MS",@progbits,1
35  .asciz "AAA"
36  .asciz "BBB"
37

served by {OpenGrok

Last Index Update: Tue Oct 21 18:42:31 GMT 2025