diff options
author | Ian Lance Taylor <ian@airs.com> | 2010-01-05 00:32:22 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2010-01-05 00:32:22 +0000 |
commit | 7eaea5495ab1b0dfbedaba749e249cfc92b9d7c6 (patch) | |
tree | c7c9bd6b9f0d43c6855d51cc0ed07ac314f4fcaa /gold/object.cc | |
parent | e44c01790d7b6959e2b7a1cbb00c9963a59ee809 (diff) | |
download | gdb-7eaea5495ab1b0dfbedaba749e249cfc92b9d7c6.zip gdb-7eaea5495ab1b0dfbedaba749e249cfc92b9d7c6.tar.gz gdb-7eaea5495ab1b0dfbedaba749e249cfc92b9d7c6.tar.bz2 |
PR 10980
* options.h (class General_options): Add --add-needed and
--copy-dt-needed-entries. Tweak --as-needed help entry.
* object.cc (Input_objects::check_dynamic_dependencies): Give an
error if --copy-dt-needed-entries aka --add-needed is used and
would cause a change in behaviour.
Diffstat (limited to 'gold/object.cc')
-rw-r--r-- | gold/object.cc | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/gold/object.cc b/gold/object.cc index 34b59b5..127e3a6 100644 --- a/gold/object.cc +++ b/gold/object.cc @@ -2162,15 +2162,15 @@ Input_objects::add_object(Object* obj) void Input_objects::check_dynamic_dependencies() const { + bool issued_copy_dt_needed_error = false; for (Dynobj_list::const_iterator p = this->dynobj_list_.begin(); p != this->dynobj_list_.end(); ++p) { const Dynobj::Needed& needed((*p)->needed()); bool found_all = true; - for (Dynobj::Needed::const_iterator pneeded = needed.begin(); - pneeded != needed.end(); - ++pneeded) + Dynobj::Needed::const_iterator pneeded; + for (pneeded = needed.begin(); pneeded != needed.end(); ++pneeded) { if (this->sonames_.find(*pneeded) == this->sonames_.end()) { @@ -2179,6 +2179,25 @@ Input_objects::check_dynamic_dependencies() const } } (*p)->set_has_unknown_needed_entries(!found_all); + + // --copy-dt-needed-entries aka --add-needed is a GNU ld option + // --that gold does not support. However, they cause no trouble + // --unless there is a DT_NEEDED entry that we don't know about; + // --warn only in that case. + if (!found_all + && !issued_copy_dt_needed_error + && (parameters->options().copy_dt_needed_entries() + || parameters->options().add_needed())) + { + const char* optname; + if (parameters->options().copy_dt_needed_entries()) + optname = "--copy-dt-needed-entries"; + else + optname = "--add-needed"; + gold_error(_("%s is not supported but is required for %s in %s"), + optname, (*pneeded).c_str(), (*p)->name().c_str()); + issued_copy_dt_needed_error = true; + } } } |