File: i386-retpoline-nopic.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 (66 lines) | stat: -rw-r--r-- 2,542 bytes parent folder | download | duplicates (14)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// REQUIRES: x86
// RUN: llvm-mc -filetype=obj -triple=i386-unknown-linux %s -o %t1.o
// RUN: llvm-mc -filetype=obj -triple=i386-unknown-linux %p/Inputs/shared.s -o %t2.o
// RUN: ld.lld -shared -soname=t2.so %t2.o -o %t2.so

// RUN: ld.lld %t1.o %t2.so -o %t.exe -z retpolineplt
// RUN: llvm-objdump --no-print-imm-hex -d -s --no-show-raw-insn %t.exe | FileCheck %s

// CHECK:      Contents of section .got.plt:
// CHECK-NEXT: 40224000 00000000 00000000 10124000
// CHECK-NEXT: 30124000

// CHECK:      Disassembly of section .plt:
// CHECK-EMPTY:
// CHECK-NEXT: <.plt>:
// CHECK-NEXT: 4011d0:       pushl   4207276
// CHECK-NEXT: 4011d6:       pushl   %eax
// CHECK-NEXT: 4011d7:       movl    4207280, %eax
// CHECK-NEXT: 4011dc:       calll   0x4011f0 <.plt+0x20>
// CHECK-NEXT: 4011e1:       pause
// CHECK-NEXT: 4011e3:       lfence
// CHECK-NEXT: 4011e6:       jmp     0x4011e1 <.plt+0x11>
// CHECK-NEXT: 4011e8:       int3
// CHECK-NEXT: 4011e9:       int3
// CHECK-NEXT: 4011ea:       int3
// CHECK-NEXT: 4011eb:       int3
// CHECK-NEXT: 4011ec:       int3
// CHECK-NEXT: 4011ed:       int3
// CHECK-NEXT: 4011ee:       int3
// CHECK-NEXT: 4011ef:       int3
// CHECK-NEXT: 4011f0:       movl    %ecx, (%esp)
// CHECK-NEXT: 4011f3:       movl    4(%esp), %ecx
// CHECK-NEXT: 4011f7:       movl    %eax, 4(%esp)
// CHECK-NEXT: 4011fb:       movl    %ecx, %eax
// CHECK-NEXT: 4011fd:       popl    %ecx
// CHECK-NEXT: 4011fe:       retl
// CHECK-NEXT: 4011ff:       int3
// CHECK-NEXT: 401200:       pushl   %eax
// CHECK-NEXT: 401201:       movl    4207284, %eax
// CHECK-NEXT: 401206:       calll   0x4011f0 <.plt+0x20>
// CHECK-NEXT: 40120b:       jmp     0x4011e1 <.plt+0x11>
// CHECK-NEXT: 401210:       pushl   $0
// CHECK-NEXT: 401215:       jmp     0x4011d0 <.plt>
// CHECK-NEXT: 40121a:       int3
// CHECK-NEXT: 40121b:       int3
// CHECK-NEXT: 40121c:       int3
// CHECK-NEXT: 40121d:       int3
// CHECK-NEXT: 40121e:       int3
// CHECK-NEXT: 40121f:       int3
// CHECK-NEXT: 401220:       pushl   %eax
// CHECK-NEXT: 401221:       movl    4207288, %eax
// CHECK-NEXT: 401226:       calll   0x4011f0 <.plt+0x20>
// CHECK-NEXT: 40122b:       jmp     0x4011e1 <.plt+0x11>
// CHECK-NEXT: 401230:       pushl   $8
// CHECK-NEXT: 401235:       jmp     0x4011d0 <.plt>
// CHECK-NEXT: 40123a:       int3
// CHECK-NEXT: 40123b:       int3
// CHECK-NEXT: 40123c:       int3
// CHECK-NEXT: 40123d:       int3
// CHECK-NEXT: 40123e:       int3
// CHECK-NEXT: 40123f:       int3

.global _start
_start:
  jmp bar@PLT
  jmp zed@PLT