2017-08-21 16:31:14 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
|
|
|
|
# RUN: ld.lld %t -o %t2
|
|
|
|
# RUN: llvm-readobj -program-headers %t2 | FileCheck %s
|
2017-08-21 22:11:08 +08:00
|
|
|
# RUN: od -Ax -x -N16 -j0x1ff0 %t2 | FileCheck %s -check-prefix=FILL
|
2017-08-21 16:31:14 +08:00
|
|
|
|
|
|
|
# CHECK: ProgramHeader {
|
|
|
|
# CHECK: Type: PT_LOAD
|
|
|
|
# CHECK: Offset: 0x1000
|
|
|
|
# CHECK-NEXT: VirtualAddress:
|
|
|
|
# CHECK-NEXT: PhysicalAddress:
|
|
|
|
# CHECK-NEXT: FileSize: 4096
|
|
|
|
# CHECK-NEXT: MemSize:
|
|
|
|
# CHECK-NEXT: Flags [
|
|
|
|
# CHECK-NEXT: PF_R
|
|
|
|
# CHECK-NEXT: PF_X
|
|
|
|
# CHECK-NEXT: ]
|
|
|
|
|
2017-08-21 22:11:08 +08:00
|
|
|
## Check that executable page is filled with traps at its end.
|
|
|
|
# FILL: 001ff0 cccc cccc cccc cccc cccc cccc cccc cccc
|
2017-08-21 16:31:14 +08:00
|
|
|
|
|
|
|
.globl _start
|
|
|
|
_start:
|
|
|
|
nop
|