免费教程_免费网赚教程_破解版软件-寂涯网络学习基地

当前位置: 主页 > 系统综合 > 各类编程 > 深入跟踪 Hello World 执行(2)

深入跟踪 Hello World 执行(2)

时间:2012-04-08 14:21来源:未知 整理:寂涯网络 点击:


068        the arguments for `main': argc, argv.       envp will be determined
069        later in  libc_start_main.     */
070     popl %esi       /** Pop the argument count.     */
071      movl %esp, %ecx       /** argv starts just at the current stack top.*/
072
073      /** Before pushing the arguments align the stack to a 16-byte
074      (SSE needs 16-byte alignment) boundary to avoid penalties from
075      misaligned accesses.     Thanks to Edward Seidl <seidl@janed.com>
076      for pointing this out.     */
077      andl $0xfffffff0, %esp
078      pushl %eax        /** Push garbage because we allocate
079                  28 more bytes.    */
080
081      /** Provide the highest stack address to the user code (for stacks
082       which grow downwards).     */
083     pushl %esp
084
085      pushl %edx        /** Push address of the shared library
086                  termination function.     */
087
088 #ifdef SHARED
089      /** Load PIC register.      */
090      call 1f
091     addl $_GLOBAL_OFFSET_TABLE_, %ebx
092
093     /** Push address of our own entry points to .fini and .init.         */
094      leal __libc_csu_fini@GOTOFF(%ebx), %eax
095     pushl %eax
096      leal __libc_csu_init@GOTOFF(%ebx), %eax
097     pushl %eax
098
099     pushl %ecx       /** Push second argument: argv.      */
100     pushl %esi       /** Push first argument: argc.      */
101
102      pushl BP_SYM (main)@GOT(%ebx)
103
104      /** Call the user's main function, and exit with its value.
105       But let the libc call main.       */
106      call BP_SYM (__libc_start_main)@PLT
107 #else
108     /** Push address of our own entry points to .fini and .init.         */
109      pushl $  libc_csu_fini
110      pushl $  libc_csu_init
111
112     pushl %ecx       /** Push second argument: argv.      */
113     pushl %esi       /** Push first argument: argc.      */
114
115      pushl $BP_SYM (main)
116
117      /** Call the user's main function, and exit with its value.
118       But let the libc call main.       */
119      call BP_SYM (__libc_start_main)
120 #endif
121
122     hlt        /** Crash if somehow `exit' does return.       */
123
124 #ifdef SHARED
125 1:    movl     (%esp), %ebx
126     ret
127 #endif
128
129 /** To fulfill the System V/i386 ABI we need this symbol.         Yuck, it's so
130    meaningless since we don't support machines < 80386.        */
131      .section .rodata
132      .globl _fp_hw

本页地址 http://www.jybase.net/biancheng/20120408819.html

百度搜索更多

谷歌搜索更多

顶一下
(1)
100%
踩一下
(0)
0%
------分隔线----------------------------

评价:
昵称: 验证码:点击我更换图片
推荐内容
赞助商
赞助商


关于本站免责声明视频更新google百度地图视频地图RRS订阅

如有什么问题请在本站留言,或发邮件到 hxt167#foxmail.com