gcc -g選項產生的.s檔案,hello.c對應的,很有參考價值!!!

來源:互聯網
上載者:User

標籤:gcc   原始碼   分析   gdb   

    .file    "hello.c"
gcc_compiled.:
.text
LC0:
    .ascii "Hello, world!\12\0"
    .align 2
.globl _main
_main:
    pushl %ebp
    movl %esp,%ebp
    pushl $LC0
    call _printf
    xorl %eax,%eax
    jmp L1
    .align 2
L1:
    leave
    ret


下面的是帶-g選項產生的hello.s

    .file    "hello.c"
gcc_compiled.:
    .stabs "hello.c",100,0,0,Ltext
Ltext:
.stabs "int:t1=r1;-2147483648;2147483647;",128,0,0,0
.stabs "char:t2=r2;0;127;",128,0,0,0
.stabs "long int:t3=r1;-2147483648;2147483647;",128,0,0,0
.stabs "unsigned int:t4=r1;0;-1;",128,0,0,0
.stabs "long unsigned int:t5=r1;0;-1;",128,0,0,0
.stabs "short int:t6=r1;-32768;32767;",128,0,0,0
.stabs "long long int:t7=r1;0;-1;",128,0,0,0
.stabs "short unsigned int:t8=r1;0;65535;",128,0,0,0
.stabs "long long unsigned int:t9=r1;0;-1;",128,0,0,0
.stabs "signed char:t10=r1;-128;127;",128,0,0,0
.stabs "unsigned char:t11=r1;0;255;",128,0,0,0
.stabs "float:t12=r1;4;0;",128,0,0,0
.stabs "double:t13=r1;8;0;",128,0,0,0
.stabs "long double:t14=r1;8;0;",128,0,0,0
.stabs "void:t15=15",128,0,0,0
.stabs "fpos_t:t3",128,0,0,0
.stabs "size_t:t4",128,0,0,0
.stabs "__stdiobuf_t:t2",128,0,0,0
.stabs "__stdiosize_t:t4",128,0,0,0
.stabs "__iobuf:T16=s44__rptr:17=*2,0,32;__rend:17,32,32;\\",128,0,0,0
.stabs "__wptr:17,64,32;__wend:17,96,32;__base:17,128,32;\\",128,0,0,0
.stabs "__bufsiz:4,160,32;__flag:6,192,16;__file:2,208,8;\\",128,0,0,0
.stabs "__buf:2,216,8;__filbuf:18=*19=f1,224,32;__flsbuf:20=*21=f1,256,32;\\",128,0,0,0
.stabs "__flush:18,288,32;__next:22=*16,320,32;;",128,0,0,0
.stabs "FILE:t16",128,0,0,0
.text
LC0:
    .ascii "Hello, world!\12\0"
    .align 2
.globl _main
_main:
    .stabd 68,0,4
    pushl %ebp
    movl %esp,%ebp
    .stabd 68,0,5
    pushl $LC0
    call _printf
    .stabd 68,0,6
    xorl %eax,%eax
    jmp L1
    .align 2
    .stabd 68,0,7
L1:
    leave
    ret
.stabs "main:F1",36,0,0,_main


gcc -g選項產生的.s檔案,hello.c對應的,很有參考價值!!!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.