Ele*_*ito 2 c assembly gcc compilation
如果我编译这段C代码:
void _start() {
}
Run Code Online (Sandbox Code Playgroud)
通过这个 gcc 调用:
gcc -nostdlib -Os -S foo.c
Run Code Online (Sandbox Code Playgroud)
我得到这个程序集列表:
.file "foo.c"
.section .text.unlikely,"x"
LCOLDB0:
.text
LHOTB0:
.globl __start
.def __start; .scl 2; .type 32; .endef
__start:
pushl %ebp
movl %esp, %ebp
popl %ebp
ret
.section .text.unlikely,"x"
LCOLDE0:
.text
LHOTE0:
.ident "GCC: (GNU) 4.9.2"
Run Code Online (Sandbox Code Playgroud)
如您所见,gcc 在代码末尾发出了“ret”指令。有没有办法让它不发出那个?