- 论坛徽章:
- 0
|
本帖最后由 beyond_touch 于 2010-08-27 16:20 编辑
- $ cat test.c
- #include <stdio.h>
- int main(int argc, char *argv[]) {
- int i;
- for (i = 0; i < 100; i++) {
- char buffer[1024];
- }
- return 0;
- }
- $ gcc -S -O0 test.c
- $ cat test.s
- .text
- .globl _main
- _main:
- LFB3:
- pushq %rbp
- LCFI0:
- movq %rsp, %rbp
- LCFI1:
- subq $1072, %rsp
- LCFI2:
- movl %edi, -1060(%rbp)
- movq %rsi, -1072(%rbp)
- movq ___stack_chk_guard@GOTPCREL(%rip), %rax
- movq (%rax), %rdx
- movq %rdx, -8(%rbp)
- xorl %edx, %edx
- movl $0, -1044(%rbp)
- jmp L2
- L3:
- incl -1044(%rbp)
- L2:
- cmpl $99, -1044(%rbp)
- jle L3
- movl $0, %eax
- movq ___stack_chk_guard@GOTPCREL(%rip), %rdx
- movq -8(%rbp), %rcx
- xorq (%rdx), %rcx
- je L6
- call ___stack_chk_fail
- L6:
- leave
- ret
- LFE3:
- .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support
- EH_frame1:
- .set L$set$0,LECIE1-LSCIE1
- .long L$set$0
- LSCIE1:
- .long 0x0
- .byte 0x1
- .ascii "zR\0"
- .byte 0x1
- .byte 0x78
- .byte 0x10
- .byte 0x1
- .byte 0x10
- .byte 0xc
- .byte 0x7
- .byte 0x8
- .byte 0x90
- .byte 0x1
- .align 3
- LECIE1:
- .globl _main.eh
- _main.eh:
- LSFDE1:
- .set L$set$1,LEFDE1-LASFDE1
- .long L$set$1
- LASFDE1:
- .long LASFDE1-EH_frame1
- .quad LFB3-.
- .set L$set$2,LFE3-LFB3
- .quad L$set$2
- .byte 0x0
- .byte 0x4
- .set L$set$3,LCFI0-LFB3
- .long L$set$3
- .byte 0xe
- .byte 0x10
- .byte 0x86
- .byte 0x2
- .byte 0x4
- .set L$set$4,LCFI1-LCFI0
- .long L$set$4
- .byte 0xd
- .byte 0x6
- .align 3
- LEFDE1:
- .subsections_via_symbols
复制代码 |
|