Some versions of GCC were optimizing out the static ctor section. This patch

makes the ctor non-static so it is not optimized out.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@917 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
Steven Dake 2006-02-10 21:05:57 +00:00
parent 166609be38
commit 96deb78110
10 changed files with 11 additions and 11 deletions

View File

@ -434,11 +434,12 @@ struct openais_service_handler *amf_get_handler_ver0 (void)
{
return (&amf_service_handler);
}
static void register_this_component (void) {
lcr_component_register (&amf_comp_ver0);
}
static void (*const __init_this_component[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
void (*const __init_this_component[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
enum clc_command_run_operation_type {
CLC_COMMAND_RUN_OPERATION_TYPE_INSTANTIATE = 1,

View File

@ -178,11 +178,10 @@ struct openais_service_handler *cfg_get_handler_ver0 (void)
return (&cfg_service_handler);
}
static void register_this_component (void) {
printf ("registering cfg component\n");
lcr_component_register (&cfg_comp_ver0);
}
static void (*const __init_this_component[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
void (*const __ctor_cfg_comp[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
/* IMPL */

View File

@ -536,7 +536,7 @@ static void register_this_component (void) {
lcr_component_register (&ckpt_comp_ver0);
}
static void (*const __init_this_component[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
void (*const __ctor_ckpt_comp[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
/*
* All data types used for executive messages

View File

@ -244,7 +244,7 @@ static void clm_comp_register (void) {
lcr_component_register (&clm_comp_ver0);
}
static void (*const __ctor_clm_comp[1]) (void) __attribute__ ((section(".ctors"))) = { clm_comp_register };
void (*const __ctor_clm_comp[1]) (void) __attribute__ ((section(".ctors"))) = { clm_comp_register };
struct req_exec_clm_nodejoin {
struct req_header header;

View File

@ -197,7 +197,7 @@ static void evs_comp_register (void) {
lcr_component_register (&evs_comp_ver0);
}
static void (*const __ctor_evs_comp[1]) (void) __attribute__ ((section(".ctors"))) = { evs_comp_register };
void (*const __ctor_evs_comp[1]) (void) __attribute__ ((section(".ctors"))) = { evs_comp_register };
struct res_evs_confchg_callback res_evs_confchg_callback;

View File

@ -262,7 +262,7 @@ static void evt_comp_register (void) {
lcr_component_register (&evt_comp_ver0);
}
static void (*const __ctor_evt_comp[1]) (void) __attribute__ ((section(".ctors"))) = { evt_comp_register };
void (*const __ctor_evt_comp[1]) (void) __attribute__ ((section(".ctors"))) = { evt_comp_register };
/*
* list of all retained events

View File

@ -336,7 +336,7 @@ static void register_this_component (void) {
lcr_component_register (&lck_comp_ver0);
}
static void (*const __init_this_component[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
void (*const __lck_ctor_comp[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
/*
* All data types used for executive messages

View File

@ -485,7 +485,7 @@ static void register_this_component (void) {
lcr_component_register (&msg_comp_ver0);
}
static void (*const __init_this_component[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
void (*const __ctor_msg_comp[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
/*
* All data types used for executive messages

View File

@ -160,4 +160,4 @@ static void register_this_component (void) {
lcr_component_register (&test_comp);
}
static void (*const __init_this_component[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
void (*const __init_libtest_a[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };

View File

@ -167,5 +167,5 @@ static void register_this_component (void)
lcr_component_register (&test_comp);
}
static void (*const __init_this_component[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
void (*const __init_libtest_b[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };