1# REQUIRES: x86 2# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1 3 4# RUN: ld.lld %t1 -z execstack -o %t 5# RUN: llvm-readobj --program-headers -S %t | FileCheck --check-prefix=RWX %s 6 7# RUN: ld.lld %t1 -o %t 8# RUN: llvm-readobj --program-headers -S %t | FileCheck --check-prefix=RW %s 9 10# RUN: ld.lld %t1 -o %t -z noexecstack 11# RUN: llvm-readobj --program-headers -S %t | FileCheck --check-prefix=RW %s 12 13# RUN: ld.lld %t1 -o %t -z nognustack 14# RUN: llvm-readobj --program-headers -s %t | FileCheck --check-prefix=NOGNUSTACK %s 15 16# RW: Type: PT_GNU_STACK 17# RW-NEXT: Offset: 0x0 18# RW-NEXT: VirtualAddress: 0x0 19# RW-NEXT: PhysicalAddress: 0x0 20# RW-NEXT: FileSize: 0 21# RW-NEXT: MemSize: 0 22# RW-NEXT: Flags [ 23# RW-NEXT: PF_R 24# RW-NEXT: PF_W 25# RW-NEXT: ] 26# RW-NEXT: Alignment: 0 27 28# RWX: Type: PT_GNU_STACK 29# RWX-NEXT: Offset: 0x0 30# RWX-NEXT: VirtualAddress: 0x0 31# RWX-NEXT: PhysicalAddress: 0x0 32# RWX-NEXT: FileSize: 0 33# RWX-NEXT: MemSize: 0 34# RWX-NEXT: Flags [ 35# RWX-NEXT: PF_R 36# RWX-NEXT: PF_W 37# RWX-NEXT: PF_X 38# RWX-NEXT: ] 39# RWX-NEXT: Alignment: 0 40 41# NOGNUSTACK-NOT: Type: PT_GNU_STACK 42 43.globl _start 44_start: 45