[1/5] winebuild: Don't use PIC code on Sparc

André Hentschel nerv at dawncrow.de
Tue Nov 29 18:09:36 CST 2011


back in 2001 when that code was added the compiler used supported that,
today gcc doesn't support ("can't compute difference between symbols in different segments") it and it seems it is not needed.
---
 tools/winebuild/import.c |   24 ++++--------------------
 1 files changed, 4 insertions(+), 20 deletions(-)

diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c
index 00c030b..b3084fe 100644
--- a/tools/winebuild/import.c
+++ b/tools/winebuild/import.c
@@ -649,26 +649,10 @@ static void output_import_thunk( const char *name, const char *table, int pos )
         output( "\tjmpq *%s+%d(%%rip)\n", table, pos );
         break;
     case CPU_SPARC:
-        if ( !UsePIC )
-        {
-            output( "\tsethi %%hi(%s+%d), %%g1\n", table, pos );
-            output( "\tld [%%g1+%%lo(%s+%d)], %%g1\n", table, pos );
-            output( "\tjmp %%g1\n" );
-            output( "\tnop\n" );
-        }
-        else
-        {
-            /* Hmpf.  Stupid sparc assembler always interprets global variable
-               names as GOT offsets, so we have to do it the long way ... */
-            output( "\tsave %%sp, -96, %%sp\n" );
-            output( "0:\tcall 1f\n" );
-            output( "\tnop\n" );
-            output( "1:\tsethi %%hi(%s+%d-0b), %%g1\n", table, pos );
-            output( "\tor %%g1, %%lo(%s+%d-0b), %%g1\n", table, pos );
-            output( "\tld [%%g1+%%o7], %%g1\n" );
-            output( "\tjmp %%g1\n" );
-            output( "\trestore\n" );
-        }
+        output( "\tsethi %%hi(%s+%d), %%g1\n", table, pos );
+        output( "\tld [%%g1+%%lo(%s+%d)], %%g1\n", table, pos );
+        output( "\tjmp %%g1\n" );
+        output( "\tnop\n" );
         break;
     case CPU_ARM:
         output( "\tldr IP,[PC,#0]\n");
-- 

Best Regards, André Hentschel



More information about the wine-patches mailing list