.file "bufdemo.c" .text .globl echo .type echo, @function echo: pushl %ebp movl %esp, %ebp pushl %ebx subl $20, %esp movl %gs:20, %eax movl %eax, -8(%ebp) xorl %eax, %eax leal -12(%ebp), %ebx movl %ebx, (%esp) call gets movl %ebx, (%esp) call puts movl -8(%ebp), %eax xorl %gs:20, %eax je .L3 call __stack_chk_fail .L3: addl $20, %esp popl %ebx popl %ebp .p2align 4,,2 ret .size echo, .-echo .section .rodata.str1.1,"aMS",@progbits,1 .LC0: .string "Type a string:" .text .globl main .type main, @function main: leal 4(%esp), %ecx andl $-16, %esp pushl -4(%ecx) pushl %ebp movl %esp, %ebp pushl %ecx subl $20, %esp movl %gs:20, %eax movl %eax, -8(%ebp) xorl %eax, %eax movl $.LC0, (%esp) call printf call echo movl $0, %eax movl -8(%ebp), %edx xorl %gs:20, %edx je .L6 call __stack_chk_fail .L6: addl $20, %esp popl %ecx popl %ebp leal -4(%ecx), %esp ret .size main, .-main .ident "GCC: (GNU) 4.1.2 20080704 (Red Hat 4.1.2-50)" .section .note.GNU-stack,"",@progbits