[llvm] Do not replace dead constant references in metadata with undef
[llvm-project.git] / lld / test / ELF / linkerscript / openbsd-randomize.s
blobb473d5110615ec62882f8040e0f42d2dcbbf3fe6
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=i686-unknown-linux %s -o %t.o
3 # RUN: echo "PHDRS { text PT_LOAD FILEHDR PHDRS; rand PT_OPENBSD_RANDOMIZE; } \
4 # RUN: SECTIONS { . = SIZEOF_HEADERS; \
5 # RUN: .text : { *(.text) } \
6 # RUN: .openbsd.randomdata : { *(.openbsd.randomdata) } : rand }" > %t.script
7 # RUN: ld.lld --script %t.script %t.o -o %t
8 # RUN: llvm-readobj --program-headers -S %t | FileCheck %s
10 # CHECK: ProgramHeader {
11 # CHECK: Type: PT_OPENBSD_RANDOMIZE (0x65A3DBE6)
12 # CHECK-NEXT: Offset: 0x74
13 # CHECK-NEXT: VirtualAddress: 0x74
14 # CHECK-NEXT: PhysicalAddress: 0x74
15 # CHECK-NEXT: FileSize: 8
16 # CHECK-NEXT: MemSize: 8
17 # CHECK-NEXT: Flags [ (0x4)
18 # CHECK-NEXT: PF_R (0x4)
19 # CHECK-NEXT: ]
20 # CHECK-NEXT: Alignment: 1
21 # CHECK-NEXT: }
23 .section .openbsd.randomdata, "a"
24 .quad 0