[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / linkerscript / sections-constraint5.s
blobce1c2c23865abf9093b94ac7cf4f04c759dbe9f0
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
3 # RUN: echo "SECTIONS { \
4 # RUN: bar : ONLY_IF_RO { sym1 = .; *(foo*) } \
5 # RUN: bar : ONLY_IF_RW { sym2 = .; *(foo*) } \
6 # RUN: }" > %t.script
8 # RUN: ld.lld -o %t -T %t.script %t.o
9 # RUN: llvm-readobj -S --symbols %t | FileCheck %s
11 # CHECK: Sections [
12 # CHECK: Name: bar
13 # CHECK-NEXT: Type: SHT_PROGBITS
14 # CHECK-NEXT: Flags [
15 # CHECK-NEXT: SHF_ALLOC
16 # CHECK-NEXT: SHF_WRITE
17 # CHECK-NEXT: ]
18 # CHECK-NEXT: Address:
19 # CHECK-NEXT: Offset:
20 # CHECK-NEXT: Size: 2
22 # CHECK: Symbols [
23 # CHECK-NOT: sym1
24 # CHECK: sym2
25 # CHECK-NOT: sym1
27 .section foo1,"a"
28 .byte 0
30 .section foo2,"aw"
31 .byte 0