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())
NULL, TWO_DASHES, &General_options::set_export_dynamic),
GENERAL_NOARG('\0', "eh-frame-hdr", N_("Create exception frame header"),
NULL, TWO_DASHES, &General_options::set_create_eh_frame_hdr),
+ GENERAL_ARG('h', "soname", N_("Set shared library name"),
+ N_("-h FILENAME, --soname FILENAME"), ONE_DASH,
+ &General_options::set_soname),
GENERAL_ARG('I', "dynamic-linker", N_("Set dynamic linker path"),
N_("-I PROGRAM, --dynamic-linker PROGRAM"), TWO_DASHES,
&General_options::set_dynamic_linker),
General_options::General_options()
: export_dynamic_(false),
+ soname_(NULL),
dynamic_linker_(NULL),
search_path_(),
optimization_level_(0),
export_dynamic() const
{ return this->export_dynamic_; }
+ // -h: shared library name.
+ const char*
+ soname() const
+ { return this->soname_; }
+
// -I: dynamic linker name.
const char*
dynamic_linker() const
set_export_dynamic()
{ this->export_dynamic_ = true; }
+ void
+ set_soname(const char* arg)
+ { this->soname_ = arg; }
+
void
set_dynamic_linker(const char* arg)
{ this->dynamic_linker_ = arg; }
add_sysroot();
bool export_dynamic_;
+ const char* soname_;
const char* dynamic_linker_;
Dir_list search_path_;
int optimization_level_;