File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -435,6 +435,22 @@ fn posixCallMainAndExit(argc_argv_ptr: [*]usize) callconv(.C) noreturn {
435
435
// Here we look for the stack size in our program headers and use setrlimit
436
436
// to ask for more stack space.
437
437
expandStackSize (phdrs );
438
+
439
+ {
440
+ const opt_init_array_start = @extern ([* ]* const fn () callconv (.C ) void , .{
441
+ .name = "__init_array_start" ,
442
+ .linkage = .weak ,
443
+ });
444
+ const opt_init_array_end = @extern ([* ]* const fn () callconv (.C ) void , .{
445
+ .name = "__init_array_end" ,
446
+ .linkage = .weak ,
447
+ });
448
+ if (opt_init_array_start ) | init_array_start | {
449
+ const init_array_end = opt_init_array_end .? ;
450
+ const slice = init_array_start [0 .. init_array_end - init_array_start ];
451
+ for (slice ) | func | func ();
452
+ }
453
+ }
438
454
}
439
455
440
456
std .posix .exit (callMainWithArgs (argc , argv , envp ));
You can’t perform that action at this time.
0 commit comments