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

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

深入跟踪 Hello World 执行(7)

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

075                void (*fini) (void),
076                void (*rtld_fini) (void),
077                void *__unbounded stack_end)
078       __attribute   ((noreturn));
079
080
081 /** Note: the fini parameter is ignored here for shared library.          It
082     is registered with __cxa_atexit.       This had the disadvantage that
083     finalizers were called in more than one place.        */
084 STATIC int
085 LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
086          int argc, char *  unbounded *  unbounded ubp_av,
087 #ifdef LIBC_START_MAIN_AUXVEC_ARG
088          ElfW(auxv_t) *  unbounded auxvec,
089 #endif
090         __typeof (main) init,
091          void (*fini) (void),
092          void (*rtld_fini) (void), void *  unbounded stack_end)
093 {
094 #if   BOUNDED_POINTERS     
095   char **argv;
096 #else
097 # define argv ubp_av
098 #endif
099
100   /** Result of the 'main' function.      */
101   int result;
102
103      libc_multiple_libcs = &_dl_starting_up && !_dl_starting_up;
104
105 #ifndef SHARED
106   char *  unbounded *__unbounded ubp_ev = &ubp_av[argc + 1];
107
108   INIT_ARGV_and_ENVIRON;
109
110   /** Store the lowest stack address.      This is done in ld.so if this is
111       the code for the DSO.      */
112      libc_stack_end = stack_end;
113
114 # ifdef HAVE_AUX_VECTOR
115    /** First process the auxiliary vector since we need to find the
116       program header to locate an eventually present PT_TLS entry.          */
117 #   ifndef LIBC_START_MAIN_AUXVEC_ARG
118    ElfW(auxv_t) *  unbounded auxvec;
119   {
120      char *  unbounded *  unbounded evp = ubp_ev;
121      while (*evp++ != NULL)
122       ;
123     auxvec = (ElfW(auxv_t) *__unbounded) evp;
124   }
125 #  endif
126    _dl_aux_init (auxvec);
127 # endif
128 # ifdef DL_SYSDEP_OSCHECK
129    if (!  libc_multiple_libcs)
130     {
131       /** This needs to run to initiliaze _dl_osversion before TLS
132       setup might check it.     */
133       DL_SYSDEP_OSCHECK (  libc_fatal);
134     }
135 # endif
136
137    /** Initialize the thread library at least a bit since the libgcc
138      functions are using thread functions if these are available and
139      we need to setup errno.     */
140      pthread_initialize_minimal ();
141
142   /** Set up the stack checker's canary.       */
143   uintptr_t stack_chk_guard = _dl_setup_stack_chk_guard ();
144 # ifdef THREAD_SET_STACK_GUARD
145    THREAD_SET_STACK_GUARD (stack_chk_guard);
146 # else
147      stack_chk_guard = stack_chk_guard;
148 # endif
149 #endif
150
151   /** Register the destructor of the dynamic linker if there is any.          */
152    if (  builtin_expect (rtld_fini != NULL, 1))
153
154
cxa_atexit ((void (*) (void *)) rtld_fini, NULL, NULL);
155 #ifndef SHARED
156   /** Call the initializer of the libc.      This is only needed here if we

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

百度搜索更多

谷歌搜索更多

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

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


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

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