2013-12-15 09:09:20 +01:00
|
|
|
|
|
|
|
extern void _pei386_runtime_relocator (void);
|
|
|
|
|
|
|
|
typedef void (*ctp)();
|
|
|
|
static void __do_global_ctors ()
|
|
|
|
{
|
|
|
|
extern int __CTOR_LIST__;
|
|
|
|
int *c = &__CTOR_LIST__;
|
|
|
|
c++;
|
|
|
|
while (*c)
|
|
|
|
{
|
|
|
|
ctp d = (ctp)*c;
|
|
|
|
(d)();
|
|
|
|
c++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-19 14:27:08 +01:00
|
|
|
int __attribute__((externally_visible)) DllStartup(void *module, int reason)
|
2013-12-15 09:09:20 +01:00
|
|
|
{
|
|
|
|
if(reason == 1)
|
|
|
|
{
|
|
|
|
_pei386_runtime_relocator();
|
|
|
|
__do_global_ctors();
|
|
|
|
};
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
};
|