1

gcc でアセンブリ コードを作成したいと考えています。使用するgcc -masm=intel -S test.cと、アセンブリコードがいっぱいに.defなり、アセンブリ.cfiできないラベルが表示されます。このラベルなしでアセンブリ コードを作成する方法はありますか?

例: 次のような単純な C コード:

int main() {
    return 0;
}

コンパイルすると:

.file   "test.c"
.intel_syntax noprefix
.def    ___main;    .scl    2;  .type   32; .endef
.text
.globl  _main
.def    _main;  .scl    2;  .type   32; .endef
_main:
LFB0:
.cfi_startproc
push    ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
mov ebp, esp
.cfi_def_cfa_register 5
and esp, -16
call    ___main
mov eax, 0
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
LFE0:

しかし、私が欲しいのは次のようなものです:

_main:
    push    ebp
    mov ebp, esp
    and esp, -16
    call    ___main
    mov eax, 0
    leave
    ret

これを行う方法があることを願っています。ありがとうございます。

4

0 に答える 0