a.c (325B)
1 /* GC root: .init_array. The constructor has no static caller — only 2 * the init_array entry references it — but it must survive --gc-sections 3 * and run before test_main. */ 4 5 static int g_flag; 6 7 __attribute__((constructor)) static void set_flag(void) { g_flag = 7; } 8 9 int test_main(void) { return g_flag == 7 ? 0 : 1; }