summaryrefslogtreecommitdiff
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
commit61b0213a2e596dbb5019f166018cc0b3d5e86f5d (patch)
tree4eaa17ddc2ebd761b3d1e070141dbeb9c0b3788c /gold/layout.cc
parent4cd4d24cd0fcd0cb5d958b56505f95c1468ae4f2 (diff)
downloadbinutils-redhat-61b0213a2e596dbb5019f166018cc0b3d5e86f5d.tar.gz
* 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 0e26116bcc..d198ce2437 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);