File: fill-trap-ppc.s

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (31 lines) | stat: -rw-r--r-- 1,670 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# REQUIRES: ppc

# RUN: llvm-mc -filetype=obj -triple=powerpc64le-linux %s -o %t.o
# RUN: ld.lld %t.o -z separate-code -o %t.ppc64le
# RUN: llvm-readelf -Sl %t.ppc64le | FileCheck %s
# RUN: od -Ax -t x1 -N16 -j0x1fff0 %t.ppc64le | FileCheck %s -check-prefix=LE

# RUN: llvm-mc -filetype=obj -triple=powerpc64-linux %s -o %t.o
# RUN: ld.lld %t.o -z separate-code -o %t.ppc64
# RUN: llvm-readelf -Sl %t.ppc64 | FileCheck %s
# RUN: od -Ax -t x1 -N16 -j0x1fff0 %t.ppc64 | FileCheck %s -check-prefix=BE

# CHECK:      [Nr] Name              Type            Address          Off    Size   ES Flg Lk Inf Al
# CHECK-NEXT: [ 0]                   NULL            0000000000000000 000000 000000 00      0   0  0
# CHECK-NEXT: [ 1] .text             PROGBITS        0000000010010000 010000 000004 00  AX  0   0  4
## TODO Remove empty .branch_lt
# CHECK-NEXT: [ 2] .branch_lt        PROGBITS        0000000010020000 020000 000000 00  WA  0   0  8
# CHECK-NEXT: [ 3] .comment          PROGBITS        0000000000000000 020000 000008 01  MS  0   0  1

# CHECK:      Type           Offset   VirtAddr           PhysAddr           FileSiz  MemSiz   Flg Align
# CHECK-NEXT: PHDR           0x000040 0x0000000010000040 0x0000000010000040 0x000118 0x000118 R   0x8
# CHECK-NEXT: LOAD           0x000000 0x0000000010000000 0x0000000010000000 0x000158 0x000158 R   0x10000
# CHECK-NEXT: LOAD           0x010000 0x0000000010010000 0x0000000010010000 0x010000 0x010000 R E 0x10000

## Check that executable page is filled with traps at its end.
# LE: 01fff0 08 00 e0 7f 08 00 e0 7f 08 00 e0 7f 08 00 e0 7f
# BE: 01fff0 7f e0 00 08 7f e0 00 08 7f e0 00 08 7f e0 00 08

.globl _start
_start:
  nop