This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gold patch committed: Implement -Bgroup


This gold patch implements the -Bgroup option.  It also slightly
corrects the implementation of the --unresolved-symbols option.
Committed to mainline.

Ian


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.


Index: layout.cc
===================================================================
RCS file: /cvs/src/src/gold/layout.cc,v
retrieving revision 1.214
diff -u -p -r1.214 layout.cc
--- layout.cc	9 Jul 2011 06:33:59 -0000	1.214
+++ layout.cc	11 Jul 2011 16:17:32 -0000
@@ -4370,6 +4370,8 @@ Layout::finish_dynamic_section(const Inp
     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);
 }
Index: options.cc
===================================================================
RCS file: /cvs/src/src/gold/options.cc,v
retrieving revision 1.113
diff -u -p -r1.113 options.cc
--- options.cc	6 Jul 2011 22:15:12 -0000	1.113
+++ options.cc	11 Jul 2011 16:17:32 -0000
@@ -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);
 
Index: options.h
===================================================================
RCS file: /cvs/src/src/gold/options.h,v
retrieving revision 1.167
diff -u -p -r1.167 options.h
--- options.h	9 Jul 2011 06:11:34 -0000	1.167
+++ options.h	11 Jul 2011 16:17:32 -0000
@@ -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);
 
Index: target-reloc.h
===================================================================
RCS file: /cvs/src/src/gold/target-reloc.h,v
retrieving revision 1.49
diff -u -p -r1.49 target-reloc.h
--- target-reloc.h	9 Jul 2011 06:11:34 -0000	1.49
+++ target-reloc.h	11 Jul 2011 16:17:32 -0000
@@ -203,6 +203,8 @@ issue_undefined_symbol_error(const Symbo
     {
       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())

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]