[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / linkerscript / sections-gc2.s
blob76be65fbdb4ebb2af890293eaeb674b21c8b563c
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
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
20 .global _start
21 _start:
22 .quad __start_used_in_reloc
24 .section unused,"a"
25 .quad 0
27 .section used_in_script,"a"
28 .quad __start_used_in_script
30 .section used_in_reloc,"a"
31 .quad 0