OSDN Git Service

Fix the C library runtime initialization order.
authorDavid 'Digit' Turner <digit@google.com>
Fri, 17 Jul 2009 23:11:10 +0000 (01:11 +0200)
committerDavid 'Digit' Turner <digit@google.com>
Fri, 17 Jul 2009 23:11:10 +0000 (01:11 +0200)
commitb56b5659b3996e98c2060f168d1cff1474e77d2a
tree11135868d3dc4a731f7288bcb00abdf48c5c7202
parentef0bd1857041ffde069cf52138aaf22c1af7130e
Fix the C library runtime initialization order.

This allows libc.so to run the C runtime initializer as soon as the
dynamic linker loads the shared library, i.e. before any other initializers
(e.g. static C++ constructors in other shared libraries the executable depends
on).

This also removes the bug where the initializers from the executable itself
were run twice: once by the dynamic linker, and another time by __libc_init
as defined by libc_init_dynamic.c
libc/bionic/libc_init_common.c
libc/bionic/libc_init_common.h
libc/bionic/libc_init_dynamic.c
libc/bionic/libc_init_static.c