xref: /llvm-project/lld/test/ELF/linkerscript/sections-gc2.s (revision fdd319655359b005889abf40d1d8a54fbd56059e)
1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
3# RUN: echo "SECTIONS { \
4# RUN:         used_in_reloc : { *(used_in_reloc) } \
5# RUN:         used_in_script : { *(used_in_script) } \
6# RUN:         .text : { *(.text) } \
7# RUN:       }" > %t.script
8# RUN: ld.lld -T %t.script -o %t.so %t.o --gc-sections -z nostart-stop-gc
9# RUN: llvm-objdump -h %t.so | FileCheck %s
10
11# CHECK: Idx Name          Size      VMA          Type
12# CHECK-NEXT:  0
13# CHECK-NEXT:    used_in_reloc
14# CHECK-NEXT:    used_in_script
15# CHECK-NEXT:    .text
16# CHECK-NEXT:    .comment
17# CHECK-NEXT:    .symtab
18# CHECK-NEXT:    .shstrtab
19# CHECK-NEXT:    .strtab
20
21        .global _start
22_start:
23        .quad __start_used_in_reloc
24
25        .section unused,"a"
26        .quad 0
27
28        .section used_in_script,"a"
29        .quad __start_used_in_script
30
31        .section used_in_reloc,"a"
32        .quad 0
33