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]

PATCH: Remove unused dump_tv_tag


Hi,

I checked in this patch to remove unused dump_tv_tag.


H.J.
--
commit e3001fd92063282c55ad251d58f112b10a0cf7d6
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Feb 11 13:35:07 2015 -0800

    
    	* testplug2.c (dump_tv_tag): Removed.
    	(onall_symbols_read): Return LDPS_ERR if the file descriptor isn't
    	closed.
    	* testplug3.c (dump_tv_tag): Removed.
    	(onclaim_file): Fix typo.

diff --git a/ld/ChangeLog b/ld/ChangeLog
index dfe8d90..7bd1c01 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,13 @@
 2015-02-11  H.J. Lu  <hongjiu.lu@intel.com>
 
+	* testplug2.c (dump_tv_tag): Removed.
+	(onall_symbols_read): Return LDPS_ERR if the file descriptor isn't
+	closed.
+	* testplug3.c (dump_tv_tag): Removed.
+	(onclaim_file): Fix typo.
+
+2015-02-11  H.J. Lu  <hongjiu.lu@intel.com>
+
 	PR ld/17878
 	* Makefile.am (noinst_LTLIBRARIES): Add libldtestplug2.la and
 	libldtestplug3.la.
diff --git a/ld/testplug2.c b/ld/testplug2.c
index 5e17b68..8cafc51 100644
--- a/ld/testplug2.c
+++ b/ld/testplug2.c
@@ -343,54 +343,6 @@ parse_option (const char *opt)
   return LDPS_OK;
 }
 
-/* Output contents of transfer vector array entry in human-readable form.  */
-static void
-dump_tv_tag (size_t n, struct ld_plugin_tv *tv)
-{
-  size_t tag;
-  char unknownbuf[40];
-  const char *name;
-
-  for (tag = 0; tag < ARRAY_SIZE (tag_names); tag++)
-    if (tag_names[tag].tag == tv->tv_tag)
-      break;
-  sprintf (unknownbuf, "unknown tag #%d", tv->tv_tag);
-  name = (tag < ARRAY_SIZE (tag_names)) ? tag_names[tag].name : unknownbuf;
-  switch (tv->tv_tag)
-    {
-      case LDPT_OPTION:
-      case LDPT_OUTPUT_NAME:
-	TV_MESSAGE (LDPL_INFO, "tv[%d]: %s '%s'", n, name,
-		    tv->tv_u.tv_string);
-        break;
-      case LDPT_REGISTER_CLAIM_FILE_HOOK:
-      case LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK:
-      case LDPT_REGISTER_CLEANUP_HOOK:
-      case LDPT_ADD_SYMBOLS:
-      case LDPT_GET_SYMBOLS:
-      case LDPT_GET_SYMBOLS_V2:
-      case LDPT_ADD_INPUT_FILE:
-      case LDPT_MESSAGE:
-      case LDPT_GET_INPUT_FILE:
-      case LDPT_GET_VIEW:
-      case LDPT_RELEASE_INPUT_FILE:
-      case LDPT_ADD_INPUT_LIBRARY:
-      case LDPT_SET_EXTRA_LIBRARY_PATH:
-	TV_MESSAGE (LDPL_INFO, "tv[%d]: %s func@0x%p", n, name,
-		    (void *)(tv->tv_u.tv_message));
-        break;
-      case LDPT_NULL:
-      case LDPT_API_VERSION:
-      case LDPT_GOLD_VERSION:
-      case LDPT_LINKER_OUTPUT:
-      case LDPT_GNU_LD_VERSION:
-      default:
-	TV_MESSAGE (LDPL_INFO, "tv[%d]: %s value %W (%d)", n, name,
-		    (bfd_vma)tv->tv_u.tv_val, tv->tv_u.tv_val);
-	break;
-    }
-}
-
 /* Handle/record information received in a transfer vector entry.  */
 static enum ld_plugin_status
 parse_tv_tag (struct ld_plugin_tv *tv)
@@ -659,9 +611,10 @@ onall_symbols_read (void)
 	}
       if (read (fd, buffer, sizeof (buffer)) >= 0)
 	{
-	  rv == LDPS_ERR;
 	  TV_MESSAGE (LDPL_FATAL, "Unreleased file descriptor on: %s",
 		      claimfile->file.name);
+	  free (filename);
+	  return LDPS_ERR;
 	}
       free (filename);
     }
diff --git a/ld/testplug3.c b/ld/testplug3.c
index a45991b..489bd7c 100644
--- a/ld/testplug3.c
+++ b/ld/testplug3.c
@@ -343,54 +343,6 @@ parse_option (const char *opt)
   return LDPS_OK;
 }
 
-/* Output contents of transfer vector array entry in human-readable form.  */
-static void
-dump_tv_tag (size_t n, struct ld_plugin_tv *tv)
-{
-  size_t tag;
-  char unknownbuf[40];
-  const char *name;
-
-  for (tag = 0; tag < ARRAY_SIZE (tag_names); tag++)
-    if (tag_names[tag].tag == tv->tv_tag)
-      break;
-  sprintf (unknownbuf, "unknown tag #%d", tv->tv_tag);
-  name = (tag < ARRAY_SIZE (tag_names)) ? tag_names[tag].name : unknownbuf;
-  switch (tv->tv_tag)
-    {
-      case LDPT_OPTION:
-      case LDPT_OUTPUT_NAME:
-	TV_MESSAGE (LDPL_INFO, "tv[%d]: %s '%s'", n, name,
-		    tv->tv_u.tv_string);
-        break;
-      case LDPT_REGISTER_CLAIM_FILE_HOOK:
-      case LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK:
-      case LDPT_REGISTER_CLEANUP_HOOK:
-      case LDPT_ADD_SYMBOLS:
-      case LDPT_GET_SYMBOLS:
-      case LDPT_GET_SYMBOLS_V2:
-      case LDPT_ADD_INPUT_FILE:
-      case LDPT_MESSAGE:
-      case LDPT_GET_INPUT_FILE:
-      case LDPT_GET_VIEW:
-      case LDPT_RELEASE_INPUT_FILE:
-      case LDPT_ADD_INPUT_LIBRARY:
-      case LDPT_SET_EXTRA_LIBRARY_PATH:
-	TV_MESSAGE (LDPL_INFO, "tv[%d]: %s func@0x%p", n, name,
-		    (void *)(tv->tv_u.tv_message));
-        break;
-      case LDPT_NULL:
-      case LDPT_API_VERSION:
-      case LDPT_GOLD_VERSION:
-      case LDPT_LINKER_OUTPUT:
-      case LDPT_GNU_LD_VERSION:
-      default:
-	TV_MESSAGE (LDPL_INFO, "tv[%d]: %s value %W (%d)", n, name,
-		    (bfd_vma)tv->tv_u.tv_val, tv->tv_u.tv_val);
-	break;
-    }
-}
-
 /* Handle/record information received in a transfer vector entry.  */
 static enum ld_plugin_status
 parse_tv_tag (struct ld_plugin_tv *tv)
@@ -595,7 +547,7 @@ onclaim_file (const struct ld_plugin_input_file *file, int *claimed)
 	}
       if (read (fd, buffer, sizeof (buffer)) >= 0)
 	{
-	  claim_file_ret == LDPS_ERR;
+	  claim_file_ret = LDPS_ERR;
 	  TV_MESSAGE (LDPL_FATAL, "Unreleased file descriptor on: %s", name);
 	}
       free (name);


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