62 lines · plain
1# REQUIRES: x862# RUN: rm -rf %t && split-file %s %t && cd %t3# RUN: llvm-mc -filetype=obj -triple=x86_64 a.s -o a.o4# RUN: llvm-mc -filetype=obj -triple=x86_64 x.s -o x.o5# RUN: llvm-mc -filetype=obj -triple=x86_64 nox.s -o nox.o6 7# RUN: ld.lld a.o -z execstack -o out8# RUN: llvm-readobj --program-headers -S out | FileCheck --check-prefix=RWX %s9 10# RUN: ld.lld a.o -o out11# RUN: llvm-readobj --program-headers -S out | FileCheck --check-prefix=RW %s12 13# RUN: ld.lld a.o -o out -z noexecstack14# RUN: llvm-readobj --program-headers -S out | FileCheck --check-prefix=RW %s15 16# RUN: ld.lld a.o -o out -z nognustack17# RUN: llvm-readobj --program-headers -s out | FileCheck --check-prefix=NOGNUSTACK %s18 19# RW: Type: PT_GNU_STACK20# RW-NEXT: Offset: 0x021# RW-NEXT: VirtualAddress: 0x022# RW-NEXT: PhysicalAddress: 0x023# RW-NEXT: FileSize: 024# RW-NEXT: MemSize: 025# RW-NEXT: Flags [26# RW-NEXT: PF_R27# RW-NEXT: PF_W28# RW-NEXT: ]29# RW-NEXT: Alignment: 030 31# RWX: Type: PT_GNU_STACK32# RWX-NEXT: Offset: 0x033# RWX-NEXT: VirtualAddress: 0x034# RWX-NEXT: PhysicalAddress: 0x035# RWX-NEXT: FileSize: 036# RWX-NEXT: MemSize: 037# RWX-NEXT: Flags [38# RWX-NEXT: PF_R39# RWX-NEXT: PF_W40# RWX-NEXT: PF_X41# RWX-NEXT: ]42# RWX-NEXT: Alignment: 043 44# NOGNUSTACK-NOT: Type: PT_GNU_STACK45 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 specified49 50# RUN: ld.lld a.o x.o nox.o x.o -z execstack --fatal-warnings51# RUN: ld.lld -r x.o --fatal-warnings52 53#--- a.s54.globl _start55_start:56 57#--- x.s58.section .note.GNU-stack,"x"59 60#--- nox.s61.section .note.GNU-stack,""62