This is the mail archive of the binutils@sources.redhat.com 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]

Re: Patch to ld/pe-dll.c: Use explicit lookup for filering excluded objects


 --- DJ Delorie <dj@delorie.com> wrote: > 
> > This all started out by fixing a bug and I've dug myself into a
> > stylistic hole as it were.
> 
> Rather than digging deeper, let's back up for a moment.  What was the
> original bug, and what is the minimum change needed to fix it, given
> what we've discussed so far?  We can leave the tables as-is for now,
> and simplify them later as a separate change. 

Okay.

ChangeLog

	2001-10-19  Danny Smith  <danny_r_smith_2001@yahoo.co.nz>

	* pe-dll.c (autofilter_objectlist):  Add startup objects
	for profiling.
	(auto-export): Constify char * p.
	Extract file basename and use strcmp rather than ststr 
	for object lookup.

--- pe-dll.c.0	Wed Oct 17 07:51:51 2001
+++ pe-dll.c	Fri Oct 19 09:41:52 2001
@@ -241,6 +241,8 @@ static autofilter_entry_type autofilter_
   { "crt2.o", 6 },
   { "dllcrt1.o", 9 },
   { "dllcrt2.o", 9 },
+  { "gcrt1.o", 7 },
+  { "gcrt2.o", 7 },  
   { NULL, 0 }
 };
 
@@ -418,7 +420,7 @@ auto_export (abfd, d, n)
 
   if (pe_dll_do_default_excludes)
     {
-      char * p;
+      const char * p;
       int    len;
 
       if (pe_dll_extra_pe_debug)
@@ -440,16 +442,16 @@ auto_export (abfd, d, n)
 	}
 
       /* Next, exclude symbols from certain startup objects.  */
-      afptr = autofilter_objlist;
 
+      if (abfd && (p = lbasename (abfd->filename)) )
+	{
+          afptr = autofilter_objlist;
       while (afptr->name)
 	{
-	  if (abfd && 
-	      (p = strstr (abfd->filename, afptr->name)) &&
-	      (*(p + afptr->len - 1) == 0))
+	      if ( strcmp (p, afptr->name) == 0 )
 	    return 0;
-
 	  afptr ++;
+	    }
 	}



http://briefcase.yahoo.com.au - Yahoo! Briefcase
- Manage your files online.


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