aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2009-10-13 21:23:00 +0000
committerIan Lance Taylor <ian@airs.com>2009-10-13 21:23:00 +0000
commitc658516291815dcfa19290644b366d8261c3fab9 (patch)
treea66b4d6debe1fc45789995366d26434bd07bf1c3 /gold/layout.cc
parent032ce4e9e37bd92e928352fca78b1eee3bb41fdd (diff)
downloadgdb-c658516291815dcfa19290644b366d8261c3fab9.zip
gdb-c658516291815dcfa19290644b366d8261c3fab9.tar.gz
gdb-c658516291815dcfa19290644b366d8261c3fab9.tar.bz2
* options.h (class General_options): Add -init and -fini.
* layout.cc (Layout::finish_dynamic_section): Emit given init and fini functions.
Diffstat (limited to 'gold/layout.cc')
-rw-r--r--gold/layout.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/gold/layout.cc b/gold/layout.cc
index 0e26116..d198ce2 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -3096,12 +3096,11 @@ Layout::finish_dynamic_section(const Input_objects* input_objects,
odyn->add_string(elfcpp::DT_SONAME, soname);
}
- // FIXME: Support --init and --fini.
- Symbol* sym = symtab->lookup("_init");
+ Symbol* sym = symtab->lookup(parameters->options().init());
if (sym != NULL && sym->is_defined() && !sym->is_from_dynobj())
odyn->add_symbol(elfcpp::DT_INIT, sym);
- sym = symtab->lookup("_fini");
+ sym = symtab->lookup(parameters->options().fini());
if (sym != NULL && sym->is_defined() && !sym->is_from_dynobj())
odyn->add_symbol(elfcpp::DT_FINI, sym);