[flang] Support OPEN(..., FORM="BINARY") (#124657)
[llvm-project.git] / lld / test / ELF / gnustack.s
blob29e81538b6cab86212218fefb884769062adc5fb
1 # REQUIRES: x86
2 # RUN: rm -rf %t && split-file %s %t && cd %t
3 # RUN: llvm-mc -filetype=obj -triple=x86_64 a.s -o a.o
4 # RUN: llvm-mc -filetype=obj -triple=x86_64 x.s -o x.o
5 # RUN: llvm-mc -filetype=obj -triple=x86_64 nox.s -o nox.o
7 # RUN: ld.lld a.o -z execstack -o out
8 # RUN: llvm-readobj --program-headers -S out | FileCheck --check-prefix=RWX %s
10 # RUN: ld.lld a.o -o out
11 # RUN: llvm-readobj --program-headers -S out | FileCheck --check-prefix=RW %s
13 # RUN: ld.lld a.o -o out -z noexecstack
14 # RUN: llvm-readobj --program-headers -S out | FileCheck --check-prefix=RW %s
16 # RUN: ld.lld a.o -o out -z nognustack
17 # RUN: llvm-readobj --program-headers -s out | FileCheck --check-prefix=NOGNUSTACK %s
19 # RW: Type: PT_GNU_STACK
20 # RW-NEXT: Offset: 0x0
21 # RW-NEXT: VirtualAddress: 0x0
22 # RW-NEXT: PhysicalAddress: 0x0
23 # RW-NEXT: FileSize: 0
24 # RW-NEXT: MemSize: 0
25 # RW-NEXT: Flags [
26 # RW-NEXT: PF_R
27 # RW-NEXT: PF_W
28 # RW-NEXT: ]
29 # RW-NEXT: Alignment: 0
31 # RWX: Type: PT_GNU_STACK
32 # RWX-NEXT: Offset: 0x0
33 # RWX-NEXT: VirtualAddress: 0x0
34 # RWX-NEXT: PhysicalAddress: 0x0
35 # RWX-NEXT: FileSize: 0
36 # RWX-NEXT: MemSize: 0
37 # RWX-NEXT: Flags [
38 # RWX-NEXT: PF_R
39 # RWX-NEXT: PF_W
40 # RWX-NEXT: PF_X
41 # RWX-NEXT: ]
42 # RWX-NEXT: Alignment: 0
44 # NOGNUSTACK-NOT: Type: PT_GNU_STACK
46 # RUN: not ld.lld a.o x.o nox.o x.o 2>&1 | FileCheck %s --check-prefix=ERR --implicit-check-not=error:
47 # RUN: not ld.lld a.o x.o nox.o x.o -z nognustack 2>&1 | FileCheck %s --check-prefix=ERR --implicit-check-not=error:
48 # ERR-COUNT-2: error: x.o: requires an executable stack, but -z execstack is not specified
50 # RUN: ld.lld a.o x.o nox.o x.o -z execstack --fatal-warnings
51 # RUN: ld.lld -r x.o --fatal-warnings
53 #--- a.s
54 .globl _start
55 _start:
57 #--- x.s
58 .section .note.GNU-stack,"x"
60 #--- nox.s
61 .section .note.GNU-stack,""