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]
Other format: [Raw text]

[REFRESH]: Remove unused "_nm_" symbols from pe-dll import libs


Hello

Ref: http://sources.redhat.com/ml/binutils/2002-04/msg00416.html

When this patch was first posted in April, it received some discussion
and I believe that Ralf answered any objections.  However, it was not
committed.

Could this patch be reconsidered?  I have retested it successfully with
current (2002-09-30) CVS on mingw32. As indicated in original
discussion, the patch removes significant bloat from import libs,
particularly those that do the 'right thing' and avoid export of data
variables.   

Danny

2002-09-30  Ralf Habacker  <Ralf.Habacker@freenet.de>

	* pe-dll.cc (autofilter_symbolprefixlist): Don't re-export
	auto-import symbols.
	(make_one): Create _nm_<symbol> for data only.


Index: pe-dll.c
===================================================================
RCS file: /cvs/src/src/ld/pe-dll.c,v
retrieving revision 1.41
diff -u -p -r1.41 pe-dll.c
--- pe-dll.c	25 May 2002 20:39:25 -0000	1.41
+++ pe-dll.c	30 Sep 2002 07:33:50 -0000
@@ -257,6 +257,8 @@ static autofilter_entry_type autofilter_
   /*  { "__imp_", 6 }, */
   /* Do __imp_ explicitly to save time.  */
   { "__rtti_", 7 },
+  /* Don't re-export auto-imported symbols.  */
+  { "_nm_", 4 },
   { "__builtin_", 10 },
   /* Don't export symbols specifying internal DLL layout.  */
   { "_head_", 6 },
@@ -1813,9 +1815,11 @@ make_one (exp, parent)
     quick_symbol (abfd, U (""), exp->internal_name, "", tx, BSF_GLOBAL, 0);
   quick_symbol (abfd, U ("_head_"), dll_symname, "", UNDSEC, BSF_GLOBAL, 0);
   quick_symbol (abfd, U ("_imp__"), exp->internal_name, "", id5, BSF_GLOBAL, 0);
-  /* Symbol to reference ord/name of imported
-     symbol, used to implement auto-import.  */
-  quick_symbol (abfd, U("_nm__"), exp->internal_name, "", id6, BSF_GLOBAL, 0);
+  /* Symbol to reference ord/name of imported data symbol,
+     used to implement auto-import.  */
+  if (exp->flag_data)
+    quick_symbol (abfd, U("_nm__"), exp->internal_name, "", id6,
+		  BSF_GLOBAL,0);
   if (pe_dll_compat_implib)
     quick_symbol (abfd, U ("__imp_"), exp->internal_name, "",
 		  id5, BSF_GLOBAL, 0);

http://mobile.yahoo.com.au - Yahoo! Messenger for SMS
- Always be connected to your Messenger Friends


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