[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / linkerscript / alternate-sections.s
blob226acafdcb911634899550a6cbebff75332cdf43
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
3 # RUN: echo "SECTIONS { abc : { *(foo) *(bar) *(zed) } }" > %t.script
4 # RUN: ld.lld -o %t --script %t.script %t.o -shared
5 # RUN: llvm-readobj -S --section-data %t | FileCheck %s
7 # CHECK: Section {
8 # CHECK: Index:
9 # CHECK: Name: abc
10 # CHECK-NEXT: Type: SHT_PROGBIT
11 # CHECK-NEXT: Flags [
12 # CHECK-NEXT: SHF_ALLOC
13 # CHECK-NEXT: SHF_MERGE
14 # CHECK-NEXT: SHF_STRINGS
15 # CHECK-NEXT: ]
16 # CHECK-NEXT: Address:
17 # CHECK-NEXT: Offset:
18 # CHECK-NEXT: Size:
19 # CHECK-NEXT: Link:
20 # CHECK-NEXT: Info:
21 # CHECK-NEXT: AddressAlignment:
22 # CHECK-NEXT: EntrySize:
23 # CHECK-NEXT: SectionData (
24 # CHECK-NEXT: 0000: 01000000 00000000 61626331 32330002 |........abc123..|
25 # CHECK-NEXT: 0010: 00000000 000000 |.......|
26 # CHECK-NEXT: )
27 # CHECK-NEXT: }
29 .section foo, "a"
30 .quad 1
32 .section bar,"aMS",@progbits,1
33 .asciz "abc123"
35 .section zed, "a"
36 .quad 2