- 论坛徽章:
- 0
|
1、未优化:
.file "test.c"
.def ___main; .scl 2; .type 32; .endef
.section .rdata,"dr"
LC0:
.ascii "t\0"
LC1:
.ascii "yes\0"
LC2:
.ascii "c\0"
LC3:
.ascii "ok\0"
LC4:
.ascii "nook\0"
.text
.globl _main
.def _main; .scl 2; .type 32; .endef
_main:
LFB7:
.cfi_startproc
.cfi_personality 0,___gxx_personality_v0
.cfi_lsda 0,LLSDA7
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
andl $-16, %esp
subl $32, %esp
call ___main
movl $LC0, 28(%esp)
movl 28(%esp), %eax
movl $100, 4(%esp)
movl %eax, (%esp)
call _strchr
testl %eax, %eax
je L2
movl $LC1, (%esp)
LEHB0:
call _printf
jmp L3
L2:
movl 28(%esp), %eax
cmpl $LC2, %eax
jne L4
movl $LC3, (%esp)
call _printf
jmp L3
L4:
movl 28(%esp), %eax
cmpl $LC0, %eax
jne L3
movl $LC4, (%esp)
call _printf
LEHE0:
L3:
movl $0, %eax
jmp L8
L7:
movl %eax, (%esp)
LEHB1:
call __Unwind_Resume
LEHE1:
L8:
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
LFE7:
.def ___gxx_personality_v0; .scl 2; .type 32; .endef
.section .gcc_except_table,"w"
LLSDA7:
.byte 0xff
.byte 0xff
.byte 0x1
.uleb128 LLSDACSE7-LLSDACSB7
LLSDACSB7:
.uleb128 LEHB0-LFB7
.uleb128 LEHE0-LEHB0
.uleb128 L7-LFB7
.uleb128 0
.uleb128 LEHB1-LFB7
.uleb128 LEHE1-LEHB1
.uleb128 0
.uleb128 0
LLSDACSE7:
.text
.def _strchr; .scl 2; .type 32; .endef
.def __Unwind_Resume; .scl 2; .type 32; .endef
.def _printf; .scl 2; .type 32; .endef
2、 -O2
.file "test.c"
.def ___main; .scl 2; .type 32; .endef
.section .rdata,"dr"
LC0:
.ascii "nook\0"
.section .text.startup,"x"
.p2align 4,,15
.globl _main
.def _main; .scl 2; .type 32; .endef
_main:
LFB7:
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
andl $-16, %esp
subl $16, %esp
call ___main
movl $LC0, (%esp)
call _printf
xorl %eax, %eax
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
LFE7:
.def _printf; .scl 2; .type 32; .endef
|
|