blob: 982169dfa2a83cb5a7445aaf72bd907959d6b354 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
/* iterate over list of constructor functions and call each element */
void do_global_ctors(const char *_ctors_start, const char *ctors_end)
{
typedef void (*func_ptr)(void);
func_ptr *func, *ctors_start = (func_ptr *) _ctors_start;
/* skip the first entry, as it contains the number of
* constructors which we don't use */
ctors_start++;
for (func = ctors_start;
*func && (func != (func_ptr *) ctors_end); func++)
(*func)();
}
|