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)
20 # CHECK-NEXT: Alignment: 1
23 .section .openbsd.randomdata, "a"