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: Add --warn-shared-textrel


I committed to patch to gold to add the --warn-shared-textrel option.

Ian


2010-01-06  Ian Lance Taylor  <iant@google.com>

	PR 10980
	* options.h (class General_options): Add --warn-shared-textrel.
	* layout.cc (Layout::finish_dynamic_section): Implement
	--warn-shared-textrel.


Index: layout.cc
===================================================================
RCS file: /cvs/src/src/gold/layout.cc,v
retrieving revision 1.156
diff -p -u -r1.156 layout.cc
--- layout.cc	6 Jan 2010 22:37:18 -0000	1.156
+++ layout.cc	7 Jan 2010 06:04:38 -0000
@@ -3355,6 +3355,10 @@ Layout::finish_dynamic_section(const Inp
       // Add a DT_TEXTREL for compatibility with older loaders.
       odyn->add_constant(elfcpp::DT_TEXTREL, 0);
       flags |= elfcpp::DF_TEXTREL;
+
+      if (parameters->options().warn_shared_textrel()
+	  && parameters->options().shared())
+	gold_warning(_("shared library text segment is not shareable"));
     }
   if (parameters->options().shared() && this->has_static_tls())
     flags |= elfcpp::DF_STATIC_TLS;
Index: options.h
===================================================================
RCS file: /cvs/src/src/gold/options.h,v
retrieving revision 1.133
diff -p -u -r1.133 options.h
--- options.h	7 Jan 2010 05:57:25 -0000	1.133
+++ options.h	7 Jan 2010 06:04:38 -0000
@@ -968,6 +968,10 @@ class General_options
 	      N_("Warn when skipping an incompatible library"),
 	      N_("Don't warn when skipping an incompatible library"));
 
+  DEFINE_bool(warn_shared_textrel, options::TWO_DASHES, '\0', false,
+	      N_("Warn if text segment is not shareable"),
+	      N_("Do not warn if text segment is not shareable (default)"));
+
   DEFINE_bool(whole_archive, options::TWO_DASHES, '\0', false,
               N_("Include all archive contents"),
               N_("Include only needed archive contents"));

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