aboutsummaryrefslogtreecommitdiff
path: root/gold/gold.cc
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2012-10-17 11:58:39 +0000
committerAlan Modra <amodra@gmail.com>2012-10-17 11:58:39 +0000
commite10f987022eacd0603f16a4e3622fa6601775db1 (patch)
tree2dfdeaff84a41909b288e1c2198b0a0e34c85f8e /gold/gold.cc
parent8de0566d7a01e024fa43e7e1bde309c718856695 (diff)
downloadgdb-e10f987022eacd0603f16a4e3622fa6601775db1.zip
gdb-e10f987022eacd0603f16a4e3622fa6601775db1.tar.gz
gdb-e10f987022eacd0603f16a4e3622fa6601775db1.tar.bz2
PR gold/14726
* gold.cc (queue_middle_tasks): Call gc_mark_symbol on _init and _fini.
Diffstat (limited to 'gold/gold.cc')
-rw-r--r--gold/gold.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/gold/gold.cc b/gold/gold.cc
index 0f9a228..30d623e 100644
--- a/gold/gold.cc
+++ b/gold/gold.cc
@@ -502,9 +502,15 @@ queue_middle_tasks(const General_options& options,
if (parameters->options().gc_sections())
{
// Find the start symbol if any.
- Symbol* start_sym = symtab->lookup(parameters->entry());
- if (start_sym != NULL)
- symtab->gc_mark_symbol(start_sym);
+ Symbol* sym = symtab->lookup(parameters->entry());
+ if (sym != NULL)
+ symtab->gc_mark_symbol(sym);
+ sym = symtab->lookup(parameters->options().init());
+ if (sym != NULL && sym->is_defined() && !sym->is_from_dynobj())
+ symtab->gc_mark_symbol(sym);
+ sym = symtab->lookup(parameters->options().fini());
+ if (sym != NULL && sym->is_defined() && !sym->is_from_dynobj())
+ symtab->gc_mark_symbol(sym);
// Symbols named with -u should not be considered garbage.
symtab->gc_mark_undef_symbols(layout);
gold_assert(symtab->gc() != NULL);