[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / linkerscript / copy-rel-symbol-value.s
blob4fe338738b6a5150eb828583ec0c576d0efd538c
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/copy-rel-symbol-value.s -o %t2.o
4 # RUN: ld.lld %t2.o -o %t2.so -shared
5 # RUN: echo "SECTIONS { . = . + SIZEOF_HEADERS; foo = bar; }" > %t.script
6 # RUN: ld.lld %t.o %t2.so --script %t.script -o %t
7 # RUN: llvm-readobj --symbols %t | FileCheck %s
9 # CHECK: Name: bar
10 # CHECK-NEXT: Value: 0x[[VAL:.*]]
11 # CHECK-NEXT: Size: 8
12 # CHECK-NEXT: Binding: Global
13 # CHECK-NEXT: Type: Object
14 # CHECK-NEXT: Other: 0
15 # CHECK-NEXT: Section: .bss.rel.ro
17 # CHECK: Name: foo
18 # CHECK-NEXT: Value: 0x[[VAL]]
19 # CHECK-NEXT: Size:
20 # CHECK-NEXT: Binding: Global
21 # CHECK-NEXT: Type:
22 # CHECK-NEXT: Other: 0
23 # CHECK-NEXT: Section: .bss.rel.ro
25 .global _start
26 _start:
27 .quad bar