fix ordering of shared library ctors with respect to libc init
authorRich Felker <dalias@aerifal.cx>
Fri, 30 Nov 2012 22:56:23 +0000 (17:56 -0500)
committerRich Felker <dalias@aerifal.cx>
Fri, 30 Nov 2012 22:56:23 +0000 (17:56 -0500)
previously, shared library constructors were being called before
important internal things like the environment (extern char **environ)
and hwcap flags (needed for sjlj to work right with float on arm) were
initialized in __libc_start_main. rather than trying to have to
dynamic linker make sure this stuff all gets initialized right, I've
opted to just defer calling shared library constructors until after
the main program's entry point is reached. this also fixes the order
of ctors to be the exact reverse of dtors, which is a desirable
property and possibly even mandated by some languages.

the main practical effect of this change is that shared libraries
calling getenv from ctors will no longer fail.


No differences found