diff options
author | Ian Lance Taylor <ian@airs.com> | 2011-07-11 16:19:51 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2011-07-11 16:19:51 +0000 |
commit | e2153196343ab5120efa49044081baaeeae8a293 (patch) | |
tree | 915dbb04574e6870b77470be41652cab8fffdb27 | |
parent | ae17ab41b73246a07697e79a36ec28deb51576f2 (diff) | |
download | binutils-e2153196343ab5120efa49044081baaeeae8a293.zip binutils-e2153196343ab5120efa49044081baaeeae8a293.tar.gz binutils-e2153196343ab5120efa49044081baaeeae8a293.tar.bz2 |
PR gold/12979
* options.h (class General_options): Add -Bgroup.
* options.cc (General_options::finalize): If -Bgroup is set,
default to --unresolved-symbols=report-all.
* layout.cc (Layout::finish_dynamic_section): Implement -Bgroup.
* target-reloc.h (issue_undefined_symbol_error): Handle
--unresolved-symbols=report-all.
-rw-r--r-- | gold/ChangeLog | 10 | ||||
-rw-r--r-- | gold/layout.cc | 2 | ||||
-rw-r--r-- | gold/options.cc | 8 | ||||
-rw-r--r-- | gold/options.h | 3 | ||||
-rw-r--r-- | gold/target-reloc.h | 2 |
5 files changed, 25 insertions, 0 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog index 07a6f29c..3dc9723 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,13 @@ +2011-07-11 Ian Lance Taylor <iant@google.com> + + PR gold/12979 + * options.h (class General_options): Add -Bgroup. + * options.cc (General_options::finalize): If -Bgroup is set, + default to --unresolved-symbols=report-all. + * layout.cc (Layout::finish_dynamic_section): Implement -Bgroup. + * target-reloc.h (issue_undefined_symbol_error): Handle + --unresolved-symbols=report-all. + 2011-07-08 Ian Lance Taylor <iant@google.com> PR gold/11985 diff --git a/gold/layout.cc b/gold/layout.cc index 40dd471..8cdf1ec 100644 --- a/gold/layout.cc +++ b/gold/layout.cc @@ -4370,6 +4370,8 @@ Layout::finish_dynamic_section(const Input_objects* input_objects, flags |= elfcpp::DF_1_ORIGIN; if (parameters->options().now()) flags |= elfcpp::DF_1_NOW; + if (parameters->options().Bgroup()) + flags |= elfcpp::DF_1_GROUP; if (flags != 0) odyn->add_constant(elfcpp::DT_FLAGS_1, flags); } diff --git a/gold/options.cc b/gold/options.cc index 16699aa..be32645 100644 --- a/gold/options.cc +++ b/gold/options.cc @@ -1168,6 +1168,14 @@ General_options::finalize() } } + // -Bgroup implies --unresolved-symbols=report-all. + if (this->Bgroup() && !this->user_set_unresolved_symbols()) + this->set_unresolved_symbols("report-all"); + + // -shared implies --allow-shlib-undefined. Currently + // ---allow-shlib-undefined controls warnings issued based on the + // -symbol table. --unresolved-symbols controls warnings issued + // -based on relocations. if (this->shared() && !this->user_set_allow_shlib_undefined()) this->set_allow_shlib_undefined(true); diff --git a/gold/options.h b/gold/options.h index 817d0f0..8fa59d7 100644 --- a/gold/options.h +++ b/gold/options.h @@ -643,6 +643,9 @@ class General_options DEFINE_bool_alias(dn, Bdynamic, options::ONE_DASH, '\0', N_("alias for -Bstatic"), NULL, true); + DEFINE_bool(Bgroup, options::ONE_DASH, '\0', false, + N_("Use group name lookup rules for shared library"), NULL); + DEFINE_bool(Bsymbolic, options::ONE_DASH, '\0', false, N_("Bind defined symbols locally"), NULL); diff --git a/gold/target-reloc.h b/gold/target-reloc.h index 87fa593..832c5d6 100644 --- a/gold/target-reloc.h +++ b/gold/target-reloc.h @@ -203,6 +203,8 @@ issue_undefined_symbol_error(const Symbol* sym) { if (strcmp(u, "ignore-all") == 0) return false; + if (strcmp(u, "report-all") == 0) + return true; if (strcmp(u, "ignore-in-object-files") == 0 && !sym->in_dyn()) return false; if (strcmp(u, "ignore-in-shared-libs") == 0 && !sym->in_reg()) |