Alexandre Julliard : winebuild: Disallow register functions in 32-bit modules.

Alexandre Julliard julliard at winehq.org
Wed Jul 26 15:41:40 CDT 2017


Module: wine
Branch: master
Commit: 9fd4647977b4ec17b827f563c675436e6ffe380b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9fd4647977b4ec17b827f563c675436e6ffe380b

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Jul 26 10:42:48 2017 +0200

winebuild: Disallow register functions in 32-bit modules.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 tools/winebuild/parser.c | 12 ++++++++++++
 tools/winebuild/spec32.c | 24 ++++++------------------
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/tools/winebuild/parser.c b/tools/winebuild/parser.c
index 2762a8c..ad99654 100644
--- a/tools/winebuild/parser.c
+++ b/tools/winebuild/parser.c
@@ -498,6 +498,18 @@ static const char *parse_spec_flags( DLLSPEC *spec, ORDDEF *odp )
                 error( "Unknown flag '%s'\n", token );
                 return NULL;
             }
+            switch (1 << i)
+            {
+            case FLAG_RET16:
+            case FLAG_REGISTER:
+                if (spec->type == SPEC_WIN32)
+                    error( "Flag '%s' is not supported in Win32\n", FlagNames[i] );
+                break;
+            case FLAG_RET64:
+                if (spec->type == SPEC_WIN16)
+                    error( "Flag '%s' is not supported in Win16\n", FlagNames[i] );
+                break;
+            }
             odp->flags |= 1 << i;
         }
         token = GetToken(0);
diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c
index 39733b2..6536cd8 100644
--- a/tools/winebuild/spec32.c
+++ b/tools/winebuild/spec32.c
@@ -68,8 +68,6 @@ static inline int needs_relay( const ORDDEF *odp )
     }
     /* skip norelay and forward entry points */
     if (odp->flags & (FLAG_NORELAY|FLAG_FORWARD)) return 0;
-    /* skip register entry points on x86_64 */
-    if (target_cpu == CPU_x86_64 && (odp->flags & FLAG_REGISTER)) return 0;
     return 1;
 }
 
@@ -179,10 +177,7 @@ static void output_relay_debug( DLLSPEC *spec )
                 output( "\tpushl %%eax\n" );
                 flags |= 2;
             }
-            if (odp->flags & FLAG_REGISTER)
-                output( "\tpushl %%eax\n" );
-            else
-                output( "\tpushl %%esp\n" );
+            output( "\tpushl %%esp\n" );
             output_cfi( ".cfi_adjust_cfa_offset 4" );
 
             if (odp->flags & FLAG_RET64) flags |= 1;
@@ -199,19 +194,12 @@ static void output_relay_debug( DLLSPEC *spec )
             output( "\tpushl %%eax\n" );
             output_cfi( ".cfi_adjust_cfa_offset 4" );
 
-            if (odp->flags & FLAG_REGISTER)
-            {
-                output( "\tcall *8(%%eax)\n" );
-            }
+            output( "\tcall *4(%%eax)\n" );
+            output_cfi( ".cfi_adjust_cfa_offset -12" );
+            if (odp->type == TYPE_STDCALL || odp->type == TYPE_THISCALL)
+                output( "\tret $%u\n", args * get_ptr_size() );
             else
-            {
-                output( "\tcall *4(%%eax)\n" );
-                output_cfi( ".cfi_adjust_cfa_offset -12" );
-                if (odp->type == TYPE_STDCALL || odp->type == TYPE_THISCALL)
-                    output( "\tret $%u\n", args * get_ptr_size() );
-                else
-                    output( "\tret\n" );
-            }
+                output( "\tret\n" );
             break;
 
         case CPU_ARM:




More information about the wine-cvs mailing list