码迷,mamicode.com
首页 > 其他好文 > 详细

gcc -g选项产生的.s文件,hello.c对应的,很有参考价值!!!

时间:2014-12-30 23:38:58      阅读:222      评论:0      收藏:0      [点我收藏+]

标签: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对应的,很有参考价值!!!

标签:gcc   源代码   分析   gdb   

原文地址:http://blog.csdn.net/oldlinux/article/details/42277507

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!