|
1 | 1 | # REQUIRES: x86
|
2 |
| -# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1 |
| 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 |
3 | 6 |
|
4 |
| -# RUN: ld.lld %t1 -z execstack -o %t |
5 |
| -# RUN: llvm-readobj --program-headers -S %t | FileCheck --check-prefix=RWX %s |
| 7 | +# RUN: ld.lld a.o -z execstack -o out |
| 8 | +# RUN: llvm-readobj --program-headers -S out | FileCheck --check-prefix=RWX %s |
6 | 9 |
|
7 |
| -# RUN: ld.lld %t1 -o %t |
8 |
| -# RUN: llvm-readobj --program-headers -S %t | FileCheck --check-prefix=RW %s |
| 10 | +# RUN: ld.lld a.o -o out |
| 11 | +# RUN: llvm-readobj --program-headers -S out | FileCheck --check-prefix=RW %s |
9 | 12 |
|
10 |
| -# RUN: ld.lld %t1 -o %t -z noexecstack |
11 |
| -# RUN: llvm-readobj --program-headers -S %t | 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 |
12 | 15 |
|
13 |
| -# RUN: ld.lld %t1 -o %t -z nognustack |
14 |
| -# RUN: llvm-readobj --program-headers -s %t | FileCheck --check-prefix=NOGNUSTACK %s |
| 16 | +# RUN: ld.lld a.o -o out -z nognustack |
| 17 | +# RUN: llvm-readobj --program-headers -s out | FileCheck --check-prefix=NOGNUSTACK %s |
15 | 18 |
|
16 | 19 | # RW: Type: PT_GNU_STACK
|
17 | 20 | # RW-NEXT: Offset: 0x0
|
|
40 | 43 |
|
41 | 44 | # NOGNUSTACK-NOT: Type: PT_GNU_STACK
|
42 | 45 |
|
| 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 |
| 49 | + |
| 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 |
| 52 | + |
| 53 | +#--- a.s |
43 | 54 | .globl _start
|
44 | 55 | _start:
|
| 56 | + |
| 57 | +#--- x.s |
| 58 | +.section .note.GNU-stack,"x" |
| 59 | + |
| 60 | +#--- nox.s |
| 61 | +.section .note.GNU-stack,"" |
0 commit comments