- 论坛徽章:
- 2
|
本帖最后由 EricFisher 于 2012-03-20 16:19 编辑
我这里试了下,没有问题。- $ cat test.c
- static void
- foo (void)
- {
- }
复制代码- $ gcc -S test.c
- $ cat test.s
- .file "test.c"
- .text
- .type foo, @function
- foo:
- pushl %ebp
- movl %esp, %ebp
- popl %ebp
- ret
- .size foo, .-foo
- .ident "GCC: (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2"
- .section .note.GNU-stack,"",@progbits
复制代码- $ gcc -c test.c
- $ objdump test.o -d
- test.o: file format elf32-i386
- Disassembly of section .text:
- 00000000 <foo>:
- 0: 55 push %ebp
- 1: 89 e5 mov %esp,%ebp
- 3: 5d pop %ebp
- 4: c3 ret
复制代码 |
|