forked from mengning/linuxkernel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassembly32_in_C.s
95 lines (94 loc) · 1.76 KB
/
assembly32_in_C.s
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
.file "assembly_in_C.c"
.text
.section .rodata
.LC0:
.string "val1:%d,val2:%d,val3:%d\n"
.LC1:
.string "val1:%d+val2:%d=val3:%d\n"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
leal 4(%esp), %ecx
.cfi_def_cfa 1, 0
andl $-16, %esp
pushl -4(%ecx)
pushl %ebp
.cfi_escape 0x10,0x5,0x2,0x75,0
movl %esp, %ebp
pushl %ebx
pushl %ecx
.cfi_escape 0xf,0x3,0x75,0x78,0x6
.cfi_escape 0x10,0x3,0x2,0x75,0x7c
subl $16, %esp
call __x86.get_pc_thunk.bx
addl $_GLOBAL_OFFSET_TABLE_, %ebx
movl %gs:20, %eax
movl %eax, -12(%ebp)
xorl %eax, %eax
movl $1, -20(%ebp)
movl $2, -16(%ebp)
movl $0, -24(%ebp)
movl -24(%ebp), %eax
pushl %eax
pushl -16(%ebp)
pushl -20(%ebp)
leal .LC0@GOTOFF(%ebx), %eax
pushl %eax
call printf@PLT
addl $16, %esp
movl -20(%ebp), %eax
movl -16(%ebp), %edx
movl %eax, %ecx
#APP
# 11 "assembly_in_C.c" 1
movl $0,%eax
addl %ecx,%eax
addl %edx,%eax
movl %eax,-24(%ebp)
# 0 "" 2
#NO_APP
movl -24(%ebp), %eax
pushl %eax
pushl -16(%ebp)
pushl -20(%ebp)
leal .LC1@GOTOFF(%ebx), %eax
pushl %eax
call printf@PLT
addl $16, %esp
movl $0, %eax
movl -12(%ebp), %edx
xorl %gs:20, %edx
je .L3
call __stack_chk_fail_local
.L3:
leal -8(%ebp), %esp
popl %ecx
.cfi_restore 1
.cfi_def_cfa 1, 0
popl %ebx
.cfi_restore 3
popl %ebp
.cfi_restore 5
leal -4(%ecx), %esp
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE0:
.size main, .-main
.section .text.__x86.get_pc_thunk.bx,"axG",@progbits,__x86.get_pc_thunk.bx,comdat
.globl __x86.get_pc_thunk.bx
.hidden __x86.get_pc_thunk.bx
.type __x86.get_pc_thunk.bx, @function
__x86.get_pc_thunk.bx:
.LFB1:
.cfi_startproc
movl (%esp), %ebx
ret
.cfi_endproc
.LFE1:
.hidden __stack_chk_fail_local
.ident "GCC: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0"
.section .note.GNU-stack,"",@progbits