[memprof] Remove an unused using directive (#117004)
[llvm-project.git] / lld / test / ELF / openbsd-phdr.s
blob275f944511701e29f6246bab5605408768e68011
1 # REQUIRES: x86
2 # RUN: rm -rf %t && split-file %s %t && cd %t
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-openbsd randomdata.s -o randomdata.o
4 # RUN: ld.lld randomdata.o -o randomdata
5 # RUN: llvm-readelf -S -l randomdata | FileCheck %s --check-prefix=RANDOMDATA
7 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-openbsd /dev/null -o wxneeded.o
8 # RUN: ld.lld -z wxneeded wxneeded.o -o wxneeded
9 # RUN: llvm-readelf -l wxneeded | FileCheck %s --check-prefix=WXNEEDED
11 # RUN: ld.lld -T lds randomdata.o -o out
12 # RUN: llvm-readelf -S -l out | FileCheck %s --check-prefixes=RANDOMDATA,CHECK
14 # RANDOMDATA: Name Type Address Off Size ES Flg Lk Inf Al
15 # RANDOMDATA: .openbsd.randomdata PROGBITS [[ADDR:[0-9a-f]+]] [[O:[0-9a-f]+]] 000008 00 A 0 0 1
17 # WXNEEDED: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
18 # WXNEEDED: OPENBSD_WXNEEDED 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 E 0
20 # RANDOMDATA: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
21 # RANDOMDATA: OPENBSD_RANDOMIZE 0x[[O]] 0x[[ADDR]] 0x[[ADDR]] 0x000008 0x000008 R 0x1
22 # CHECK-NEXT: OPENBSD_BOOTDATA 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 R 0
23 # CHECK-NEXT: OPENBSD_MUTABLE 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 R 0
24 # CHECK-NEXT: OPENBSD_SYSCALLS 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 R 0
25 # CHECK-NEXT: OPENBSD_WXNEEDED 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 R 0
27 #--- randomdata.s
28 .section .openbsd.randomdata, "a"
29 .quad 0
31 #--- lds
32 PHDRS {
33 text PT_LOAD FILEHDR PHDRS;
34 rand PT_OPENBSD_RANDOMIZE;
35 boot PT_OPENBSD_BOOTDATA;
36 mutable PT_OPENBSD_MUTABLE;
37 syscalls PT_OPENBSD_SYSCALLS;
38 wxneeded PT_OPENBSD_WXNEEDED;
40 SECTIONS {
41 . = SIZEOF_HEADERS;
42 .text : { *(.text) }
43 .openbsd.randomdata : { *(.openbsd.randomdata) } : rand