我刚刚翻译了这个程序,

#include <stdio.h>

int dam[1000][1000];


int main (int argc, const char * argv[]) {
    // insert code here...
    printf("Hello, World!\n");
    return 0;
}

使用gcc生产进行组装,
    .cstring
LC0:
    .ascii "Hello, World!\0"
    .text
.globl _main
_main:
    pushl   %ebp
    movl    %esp, %ebp
    pushl   %ebx
    subl    $20, %esp
    call    L3
"L00000000001$pb":
L3:
    popl    %ebx
    leal    LC0-"L00000000001$pb"(%ebx), %eax
    movl    %eax, (%esp)
    call    L_puts$stub
    movl    $0, %eax
    addl    $20, %esp
    popl    %ebx
    leave
    ret
.comm _dam,1000000,5
    .section __IMPORT,__jump_table,symbol_stubs,self_modifying_code+pure_instructions,5
L_puts$stub:
    .indirect_symbol _puts
    hlt ; hlt ; hlt ; hlt ; hlt
    .subsections_via_symbols

.comm是什么意思?大坝会使用堆空间,堆栈空间还是数据空间?

最佳答案

as手册中:

关于gcc - .comm是什么意思?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/501105/

10-11 07:25