winebuild: Support generating a .spec.o file for Windows platforms.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
stable
Alexandre Julliard 2019-03-12 10:02:04 +01:00
parent 7cb188fdb1
commit e4b9a501a3
4 changed files with 31 additions and 5 deletions

View File

@ -303,6 +303,7 @@ extern int load_res32_file( const char *name, DLLSPEC *spec );
extern void output_resources( DLLSPEC *spec );
extern void output_bin_resources( DLLSPEC *spec, unsigned int start_rva );
extern void output_spec32_file( DLLSPEC *spec );
extern void output_pe_module( DLLSPEC *spec );
extern void output_fake_module( DLLSPEC *spec );
extern void output_def_file( DLLSPEC *spec, int include_private );
extern void load_res16_file( const char *name, DLLSPEC *spec );

View File

@ -645,7 +645,8 @@ int main(int argc, char **argv)
output_spec16_file( spec );
break;
case SPEC_WIN32:
output_spec32_file( spec );
if (target_platform == PLATFORM_WINDOWS) output_pe_module( spec );
else output_spec32_file( spec );
break;
default: assert(0);
}

View File

@ -441,7 +441,7 @@ void output_resources( DLLSPEC *spec )
/* output the resource directories */
output( "\n/* resources */\n\n" );
output( "\t.data\n" );
output( "\t.section %s\n", target_platform == PLATFORM_WINDOWS ? ".rsrc" : ".data" );
output( "\t.align %d\n", get_alignment(get_ptr_size()) );
output( ".L__wine_spec_resources:\n" );
@ -498,9 +498,12 @@ void output_resources( DLLSPEC *spec )
output( ".L__wine_spec_res_%d:\n", i );
dump_res_data( res );
}
output( ".L__wine_spec_resources_end:\n" );
output( "\t.byte 0\n" );
if (target_platform != PLATFORM_WINDOWS)
{
output( ".L__wine_spec_resources_end:\n" );
output( "\t.byte 0\n" );
}
free_resource_tree( tree );
}

View File

@ -384,7 +384,7 @@ void output_exports( DLLSPEC *spec )
if (!nr_exports) return;
output( "\n/* export table */\n\n" );
output( "\t.data\n" );
output( "\t.section %s\n", target_platform == PLATFORM_WINDOWS ? ".edata" : ".data" );
output( "\t.align %d\n", get_alignment(4) );
output( ".L__wine_spec_exports:\n" );
@ -492,6 +492,9 @@ void output_exports( DLLSPEC *spec )
output( "\t%s \"%s\"\n", get_asm_string_keyword(), odp->link_name );
}
}
if (target_platform == PLATFORM_WINDOWS) return;
output( "\t.align %d\n", get_alignment(get_ptr_size()) );
output( ".L__wine_spec_exports_end:\n" );
@ -707,6 +710,24 @@ void output_spec32_file( DLLSPEC *spec )
}
/*******************************************************************
* output_pe_module
*
* Build a PE from a spec file.
*/
void output_pe_module( DLLSPEC *spec )
{
UsePIC = 0;
resolve_imports( spec );
open_output_file();
output_standard_file_header();
output_stubs( spec );
output_exports( spec );
output_resources( spec );
close_output_file();
}
/*******************************************************************
* output_fake_module
*