winebuild: Fix export section - exported names should be part of it

Vitaliy Margolen wine-patch at kievinfo.com
Tue Aug 23 11:15:45 CDT 2005


Exported names should be a part of an export section.

Vitaliy Margolen

changelog:
  tools/winebuild/spec32.c8
    Fix export section - exported names should be part of it
-------------- next part --------------
Index: tools/winebuild/spec32.c
===================================================================
RCS file: /home/wine/wine/tools/winebuild/spec32.c,v
retrieving revision 1.100
diff -u -p -r1.100 spec32.c
--- tools/winebuild/spec32.c	26 Jul 2005 18:57:19 -0000	1.100
+++ tools/winebuild/spec32.c	23 Aug 2005 16:12:03 -0000
@@ -127,7 +127,7 @@ static int output_debug( FILE *outfile )
 static int get_exports_size( DLLSPEC *spec )
 {
     int nr_exports = spec->base <= spec->limit ? spec->limit - spec->base + 1 : 0;
-    int i, fwd_size = 0, total_size;
+    int i, fwd_size = 0, expn_size = 0, total_size;
 
     if (!nr_exports) return 0;
 
@@ -150,7 +150,12 @@ static int get_exports_size( DLLSPEC *sp
         ORDDEF *odp = spec->ordinals[i];
         if (odp && odp->flags & FLAG_FORWARD) fwd_size += strlen(odp->link_name) + 1;
     }
-    total_size += (fwd_size + 3) & ~3;
+
+    /* exported names strings */
+    for (i = 0; i < spec->nb_names; i++)
+        expn_size += strlen(spec->names[i]->name) + 1;
+
+    total_size += (fwd_size + expn_size + 3) & ~3;
 
     return total_size;
 }
@@ -167,11 +172,11 @@ static void output_export_names( FILE *o
 
     if (!nr_exports) return;
 
-    fprintf( outfile, "\nconst char __wine_spec_exp_names[] =" );
-    fprintf( outfile, "\n    \"%s\\0\"", spec->file_name );
+    fprintf( outfile, "    \"__wine_spec_exp_names:\\n\"\n" );
+    fprintf( outfile, "    \"\\t.ascii \\\"%s\\\"\\n\"\n    \"\\t.byte 0\\n\"\n", spec->file_name );
+
     for (i = 0; i < spec->nb_names; i++)
-        fprintf( outfile, "\n    \"%s\\0\"", spec->names[i]->name );
-    fprintf( outfile, ";\n" );
+        fprintf( outfile, "    \"\\t.ascii \\\"%s\\\"\\n\"\n    \"\\t.byte 0\\n\"\n", spec->names[i]->name );
 }
 
 
@@ -275,6 +280,9 @@ static void output_exports( FILE *outfil
         }
     }
 
+    /* output the export names */
+    output_export_names( outfile, spec );
+
     /* output forward strings */
 
     if (fwd_size)
@@ -535,7 +543,6 @@ void BuildSpec32File( FILE *outfile, DLL
         fprintf( outfile, "#define __stdcall\n\n" );
 
     output_stub_funcs( outfile, spec );
-    output_export_names( outfile, spec );
 
     /* Output the DLL imports */
 


More information about the wine-patches mailing list