From: Zebediah Figura zfigura@codeweavers.com
We always compile i386 code without PIC in Wine, and I do not see a reason to support non-PIC 16-bit modules for winelib. --- tools/winebuild/relay.c | 21 +++------------------ tools/winebuild/spec16.c | 9 +-------- 2 files changed, 4 insertions(+), 26 deletions(-)
diff --git a/tools/winebuild/relay.c b/tools/winebuild/relay.c index b86a88aae24..31a8be976c0 100644 --- a/tools/winebuild/relay.c +++ b/tools/winebuild/relay.c @@ -130,34 +130,19 @@ static void BuildCallFrom16Core( int reg_func, int thunk ) /* Save original EFlags register */ if (reg_func) output( "\tpushfl\n" );
- if ( UsePIC ) - { - output( "\tcall 1f\n" ); - output( "1:\tpopl %%ecx\n" ); - output( "\t.byte 0x2e\n\tmovl %s-1b(%%ecx),%%edx\n", asm_name("CallTo16_DataSelector") ); - } - else - output( "\t.byte 0x2e\n\tmovl %s,%%edx\n", asm_name("CallTo16_DataSelector") );
/* Load 32-bit segment registers */ + output( "\t.byte 0x2e\n\tmovl %s,%%edx\n", asm_name("CallTo16_DataSelector") ); output( "\tmovw %%dx, %%ds\n" ); output( "\tmovw %%dx, %%es\n" ); - - if ( UsePIC ) - output( "\tmovw %s-1b(%%ecx), %%fs\n", asm_name("CallTo16_TebSelector") ); - else - output( "\tmovw %s, %%fs\n", asm_name("CallTo16_TebSelector") ); - + output( "\tmovw %s, %%fs\n", asm_name("CallTo16_TebSelector") ); output( "\t.byte 0x64\n\tmov (%d),%%gs\n", GS_OFFSET );
/* Translate STACK16FRAME base to flat offset in %edx */ output( "\tmovw %%ss, %%dx\n" ); output( "\tandl $0xfff8, %%edx\n" ); output( "\tshrl $1, %%edx\n" ); - if (UsePIC) - output( "\taddl .Lwine_ldt_copy_ptr-1b(%%ecx),%%edx\n" ); - else - output( "\taddl .Lwine_ldt_copy_ptr,%%edx\n" ); + output( "\taddl .Lwine_ldt_copy_ptr,%%edx\n" ); output( "\tmovl (%%edx), %%edx\n" ); output( "\tmovzwl %%sp, %%ebp\n" ); output( "\tleal %d(%%ebp,%%edx), %%edx\n", reg_func ? 0 : -4 ); diff --git a/tools/winebuild/spec16.c b/tools/winebuild/spec16.c index 8d4f96ea323..97567bab4c1 100644 --- a/tools/winebuild/spec16.c +++ b/tools/winebuild/spec16.c @@ -353,14 +353,7 @@ static void output_call16_function( ORDDEF *odp ) output( "\tpushl %%esi\n" ); output_cfi( ".cfi_rel_offset %%esi,-4" ); stack_words++; - if (UsePIC) - { - output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") ); - output( "1:\tmovl .Lwine_ldt_copy_ptr-1b(%%eax),%%esi\n" ); - needs_get_pc_thunk = 1; - } - else - output( "\tmovl .Lwine_ldt_copy_ptr,%%esi\n" ); + output( "\tmovl .Lwine_ldt_copy_ptr,%%esi\n" ); }
/* preserve 16-byte stack alignment */