public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [GOLD] powerpc target select
@ 2012-12-10 11:44 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2012-12-10 11:44 UTC (permalink / raw)
  To: binutils

The powerpc do_recognize does nothing but match EM_PPC/EM_PPC64,
which can be done in target-select.cc:select_target().

	* powerpc.cc (Target_selector_powerpc::Target_selector_powerpc):
	Set EM_PPC64 or EM_PPC here.
	(Target_selector_powerpc::do_recognize): Delete.

Index: gold/powerpc.cc
===================================================================
RCS file: /cvs/src/src/gold/powerpc.cc,v
retrieving revision 1.77
diff -u -p -r1.77 powerpc.cc
--- gold/powerpc.cc	10 Dec 2012 11:30:57 -0000	1.77
+++ gold/powerpc.cc	10 Dec 2012 11:32:06 -0000
@@ -6942,7 +6942,8 @@ class Target_selector_powerpc : public T
 {
 public:
   Target_selector_powerpc()
-    : Target_selector(elfcpp::EM_NONE, size, big_endian,
+    : Target_selector(size == 64 ? elfcpp::EM_PPC64 : elfcpp::EM_PPC,
+		      size, big_endian,
 		      (size == 64
 		       ? (big_endian ? "elf64-powerpc" : "elf64-powerpcle")
 		       : (big_endian ? "elf32-powerpc" : "elf32-powerpcle")),
@@ -6952,28 +6953,6 @@ public:
   { }
 
   virtual Target*
-  do_recognize(Input_file*, off_t, int machine, int, int)
-  {
-    switch (size)
-      {
-      case 64:
-	if (machine != elfcpp::EM_PPC64)
-	  return NULL;
-	break;
-
-      case 32:
-	if (machine != elfcpp::EM_PPC)
-	  return NULL;
-	break;
-
-      default:
-	return NULL;
-      }
-
-    return this->instantiate_target();
-  }
-
-  virtual Target*
   do_instantiate_target()
   { return new Target_powerpc<size, big_endian>(); }
 };

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-12-10 11:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-10 11:44 [GOLD] powerpc target select Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).