Can you explain why gcc -S output something like assemble?

Posted by Mask on Stack Overflow See other posts from Stack Overflow or by Mask
Published on 2010-03-28T16:35:07Z Indexed on 2010/03/28 16:43 UTC
Read the original article Hit count: 288

Filed under:
|
$ gcc -S buffer-overflow.c && cat buffer-overflow.s 
_foo: 
        pushl   %ebp           ;2 
        movl    %esp, %ebp     ;3 
        subl    $16, %esp      ;4 
        movl    LC1, %eax      ;5 
        movl    %eax, -4(%ebp) ;6 
        leal    -4(%ebp), %eax ;7 
        leal    8(%eax), %edx  ;8 
        movl    $_bad, %eax    ;9 
        movl    %eax, (%edx)   ;10 
        leave 
        ret 

_main: 
    ... 
        call    _foo            ;1 
    ... 

The help information says it should not compile nor assemble:

 -S                       Compile only; do not assemble or link

Why are they contradictory?

© Stack Overflow or respective owner

Related posts about gcc

Related posts about switch