[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / linkerscript / emit-relocs-rela-dyn.s
bloba6c627fb18ce3870dea7e07cd5323eb003c469a1
1 # REQUIRES: x86
2 ## PR48357: If .rela.dyn appears as an output section description, its type may
3 ## be SHT_RELA (due to the empty synthetic .rela.plt) while there is no input
4 ## section. The empty .rela.dyn may be retained due to a reference. Don't crash.
6 # RUN: llvm-mc -filetype=obj -triple=x86_64 /dev/null -o %t.o
7 # RUN: ld.lld -shared --emit-relocs -T %s %t.o -o %t
8 # RUN: llvm-readelf -S %t | FileCheck %s
10 ## Note, sh_link of such an empty .rela.dyn is 0.
11 # CHECK: Name Type Address Off Size ES Flg Lk Inf Al
12 # CHECK: .rela.dyn RELA 0000000000000000 001000 000000 18 A 0 0 8
14 SECTIONS {
15 .rela.dyn : { *(.rela*) }
16 __rela_offset = ABSOLUTE(ADDR(.rela.dyn));