aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2008-01-04 05:35:24 +0000
committerIan Lance Taylor <iant@google.com>2008-01-04 05:35:24 +0000
commitfced7afdce32a299d799f52ebd92a92572c2f9f5 (patch)
treea516bc2854971865b63f828e7ec9be8e865be6f1 /gold/layout.cc
parent1bedcac52a2f05841dcdefcd1248ae3393274471 (diff)
downloadgdb-fced7afdce32a299d799f52ebd92a92572c2f9f5.zip
gdb-fced7afdce32a299d799f52ebd92a92572c2f9f5.tar.gz
gdb-fced7afdce32a299d799f52ebd92a92572c2f9f5.tar.bz2
Add -h/-soname option.
Diffstat (limited to 'gold/layout.cc')
-rw-r--r--gold/layout.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/gold/layout.cc b/gold/layout.cc
index eebb26c..75aecfe 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -1713,6 +1713,13 @@ Layout::finish_dynamic_section(const Input_objects* input_objects,
odyn->add_string(elfcpp::DT_NEEDED, (*p)->soname());
}
+ if (parameters->output_is_shared())
+ {
+ const char* soname = this->options_.soname();
+ if (soname != NULL)
+ odyn->add_string(elfcpp::DT_SONAME, soname);
+ }
+
// FIXME: Support --init and --fini.
Symbol* sym = symtab->lookup("_init");
if (sym != NULL && sym->is_defined() && !sym->is_from_dynobj())