gold patch: fix problem with conditional compilation

Cary Coutant ccoutant@google.com
Thu Oct 2 18:36:00 GMT 2008


This patch fixes some bad conditional compilation that I put in the
new plugin.cc file with the LTO support patch. It worked fine with
--enable-targets=all, but when enabling only little-endian targets,
the file wouldn't compile because of a spurious 'else'.

Committed as obvious.

-cary


	* plugin.cc (make_sized_plugin_object): Fix conditional
	compilation to work when not all targets are enabled.


Index: plugin.cc
===================================================================
RCS file: /cvs/src/src/gold/plugin.cc,v
retrieving revision 1.1
diff -u -p -r1.1 plugin.cc
--- plugin.cc	19 Sep 2008 22:54:57 -0000	1.1
+++ plugin.cc	2 Oct 2008 18:32:21 -0000
@@ -935,28 +935,44 @@ make_sized_plugin_object(Input_file* inp

   if (target->get_size() == 32)
     {
-#ifdef HAVE_TARGET_32_BIG
       if (target->is_big_endian())
+#ifdef HAVE_TARGET_32_BIG
         obj = new Sized_pluginobj<32, true>(input_file->filename(),
                                             input_file, offset);
+#else
+        gold_error(_("%s: not configured to support "
+		     "32-bit big-endian object"),
+		   input_file->filename().c_str());
 #endif
-#ifdef HAVE_TARGET_32_LITTLE
       else
+#ifdef HAVE_TARGET_32_LITTLE
         obj = new Sized_pluginobj<32, false>(input_file->filename(),
                                              input_file, offset);
+#else
+        gold_error(_("%s: not configured to support "
+		     "32-bit little-endian object"),
+		   input_file->filename().c_str());
 #endif
     }
   else if (target->get_size() == 64)
     {
-#ifdef HAVE_TARGET_64_BIG
       if (target->is_big_endian())
+#ifdef HAVE_TARGET_64_BIG
         obj = new Sized_pluginobj<64, true>(input_file->filename(),
                                             input_file, offset);
+#else
+        gold_error(_("%s: not configured to support "
+		     "64-bit big-endian object"),
+		   input_file->filename().c_str());
 #endif
-#ifdef HAVE_TARGET_64_LITTLE
       else
+#ifdef HAVE_TARGET_64_LITTLE
         obj = new Sized_pluginobj<64, false>(input_file->filename(),
                                              input_file, offset);
+#else
+        gold_error(_("%s: not configured to support "
+		     "64-bit little-endian object"),
+		   input_file->filename().c_str());
 #endif
     }



More information about the Binutils mailing list