aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index cbd5bc3..b074169 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -6692,6 +6692,22 @@ lang_process (void)
link_info.gc_sym_list = &entry_symbol;
if (entry_symbol.name == NULL)
link_info.gc_sym_list = ldlang_undef_chain_list_head;
+ if (link_info.init_function != NULL)
+ {
+ struct bfd_sym_chain *sym
+ = (struct bfd_sym_chain *) stat_alloc (sizeof (*sym));
+ sym->next = link_info.gc_sym_list;
+ sym->name = link_info.init_function;
+ link_info.gc_sym_list = sym;
+ }
+ if (link_info.fini_function != NULL)
+ {
+ struct bfd_sym_chain *sym
+ = (struct bfd_sym_chain *) stat_alloc (sizeof (*sym));
+ sym->next = link_info.gc_sym_list;
+ sym->name = link_info.fini_function;
+ link_info.gc_sym_list = sym;
+ }
ldemul_after_open ();
if (config.map_file != NULL)