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:    .text
15# CHECK-NEXT:    .comment
16# CHECK-NEXT:    .symtab
17# CHECK-NEXT:    .shstrtab
18# CHECK-NEXT:    .strtab
19
20        .global _start
21_start:
22        .quad __start_used_in_reloc
23
24        .section unused,"a"
25        .quad 0
26
27        .section used_in_script,"a"
28        .quad __start_used_in_script
29
30        .section used_in_reloc,"a"
31        .quad 0
32