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]

ldlang.c lookup_name


lookup_name never has a NULL "name" arg, as can be easily verified by
checking all call sites.  So delete the dead code.  From that,
"filename" can never be NULL, so we get rid of one FIXME.  The other
FIXME regarding search->real is bogus because pe-dll.c creates
lang_input_file_is_fake_enum input statements, which have "real" clear,
and they would otherwise match wildcards.

	* ldlang.c (lookup_name): Delete dead code.  Remove FIXMEs.

Index: ld/ldlang.c
===================================================================
RCS file: /cvs/src/src/ld/ldlang.c,v
retrieving revision 1.219
diff -u -p -r1.219 ldlang.c
--- ld/ldlang.c	19 May 2006 06:09:31 -0000	1.219
+++ ld/ldlang.c	5 Jun 2006 04:22:31 -0000
@@ -2214,12 +2214,9 @@ lookup_name (const char *name)
       /* Use the local_sym_name as the name of the file that has
 	 already been loaded as filename might have been transformed
 	 via the search directory lookup mechanism.  */
-      const char * filename = search->local_sym_name;
+      const char *filename = search->local_sym_name;
 
-      if (filename == NULL && name == NULL)
-	return search;
       if (filename != NULL
-	  && name != NULL
 	  && strcmp (filename, name) == 0)
 	break;
     }
@@ -2229,11 +2226,8 @@ lookup_name (const char *name)
 			default_target, FALSE);
 
   /* If we have already added this file, or this file is not real
-     (FIXME: can that ever actually happen?) or the name is NULL
-     (FIXME: can that ever actually happen?) don't add this file.  */
-  if (search->loaded
-      || ! search->real
-      || search->filename == NULL)
+     don't add this file.  */
+  if (search->loaded || !search->real)
     return search;
 
   if (! load_symbols (search, NULL))

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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