winebuild: Use exports struct for 16-bit modules handlign.
This commit is contained in:
parent
499c6be734
commit
6ee0583546
1 changed files with 19 additions and 18 deletions
|
@ -103,7 +103,7 @@ static void output_entries( DLLSPEC *spec, int first, int count )
|
||||||
|
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
ORDDEF *odp = spec->ordinals[first + i];
|
ORDDEF *odp = spec->exports.ordinals[first + i];
|
||||||
output( "\t.byte 0x03\n" ); /* flags: exported & public data */
|
output( "\t.byte 0x03\n" ); /* flags: exported & public data */
|
||||||
switch (odp->type)
|
switch (odp->type)
|
||||||
{
|
{
|
||||||
|
@ -134,10 +134,10 @@ static void output_entry_table( DLLSPEC *spec )
|
||||||
{
|
{
|
||||||
int i, prev = 0, prev_sel = -1, bundle_count = 0;
|
int i, prev = 0, prev_sel = -1, bundle_count = 0;
|
||||||
|
|
||||||
for (i = 1; i <= spec->limit; i++)
|
for (i = 1; i <= spec->exports.limit; i++)
|
||||||
{
|
{
|
||||||
int selector = 0;
|
int selector = 0;
|
||||||
ORDDEF *odp = spec->ordinals[i];
|
ORDDEF *odp = spec->exports.ordinals[i];
|
||||||
if (!odp) continue;
|
if (!odp) continue;
|
||||||
if (odp->flags & FLAG_EXPORT32) continue;
|
if (odp->flags & FLAG_EXPORT32) continue;
|
||||||
|
|
||||||
|
@ -499,17 +499,18 @@ static int relay_type_compare( const void *e1, const void *e2 )
|
||||||
*/
|
*/
|
||||||
static void output_module16( DLLSPEC *spec )
|
static void output_module16( DLLSPEC *spec )
|
||||||
{
|
{
|
||||||
|
struct exports *exports = &spec->exports;
|
||||||
ORDDEF **typelist;
|
ORDDEF **typelist;
|
||||||
ORDDEF *entry_point = NULL;
|
ORDDEF *entry_point = NULL;
|
||||||
int i, j, nb_funcs;
|
int i, j, nb_funcs;
|
||||||
|
|
||||||
/* store the main entry point as ordinal 0 */
|
/* store the main entry point as ordinal 0 */
|
||||||
|
|
||||||
if (!spec->ordinals)
|
if (!exports->ordinals)
|
||||||
{
|
{
|
||||||
assert(spec->limit == 0);
|
assert(exports->limit == 0);
|
||||||
spec->ordinals = xmalloc( sizeof(spec->ordinals[0]) );
|
exports->ordinals = xmalloc( sizeof(exports->ordinals[0]) );
|
||||||
spec->ordinals[0] = NULL;
|
exports->ordinals[0] = NULL;
|
||||||
}
|
}
|
||||||
if (spec->init_func && !(spec->characteristics & IMAGE_FILE_DLL))
|
if (spec->init_func && !(spec->characteristics & IMAGE_FILE_DLL))
|
||||||
{
|
{
|
||||||
|
@ -522,17 +523,17 @@ static void output_module16( DLLSPEC *spec )
|
||||||
entry_point->link_name = xstrdup( spec->init_func );
|
entry_point->link_name = xstrdup( spec->init_func );
|
||||||
entry_point->export_name = NULL;
|
entry_point->export_name = NULL;
|
||||||
entry_point->u.func.nb_args = 0;
|
entry_point->u.func.nb_args = 0;
|
||||||
assert( !spec->ordinals[0] );
|
assert( !exports->ordinals[0] );
|
||||||
spec->ordinals[0] = entry_point;
|
exports->ordinals[0] = entry_point;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Build sorted list of all argument types, without duplicates */
|
/* Build sorted list of all argument types, without duplicates */
|
||||||
|
|
||||||
typelist = xmalloc( (spec->limit + 1) * sizeof(*typelist) );
|
typelist = xmalloc( (exports->limit + 1) * sizeof(*typelist) );
|
||||||
|
|
||||||
for (i = nb_funcs = 0; i <= spec->limit; i++)
|
for (i = nb_funcs = 0; i <= exports->limit; i++)
|
||||||
{
|
{
|
||||||
ORDDEF *odp = spec->ordinals[i];
|
ORDDEF *odp = exports->ordinals[i];
|
||||||
if (!odp) continue;
|
if (!odp) continue;
|
||||||
if (is_function( odp )) typelist[nb_funcs++] = odp;
|
if (is_function( odp )) typelist[nb_funcs++] = odp;
|
||||||
}
|
}
|
||||||
|
@ -629,9 +630,9 @@ static void output_module16( DLLSPEC *spec )
|
||||||
output( "\n\t.balign 2\n" );
|
output( "\n\t.balign 2\n" );
|
||||||
output( ".L__wine_spec_ne_restab:\n" );
|
output( ".L__wine_spec_ne_restab:\n" );
|
||||||
output_resident_name( spec->dll_name, 0 );
|
output_resident_name( spec->dll_name, 0 );
|
||||||
for (i = 1; i <= spec->limit; i++)
|
for (i = 1; i <= exports->limit; i++)
|
||||||
{
|
{
|
||||||
ORDDEF *odp = spec->ordinals[i];
|
ORDDEF *odp = exports->ordinals[i];
|
||||||
if (!odp || !odp->name[0]) continue;
|
if (!odp || !odp->name[0]) continue;
|
||||||
if (odp->flags & FLAG_EXPORT32) continue;
|
if (odp->flags & FLAG_EXPORT32) continue;
|
||||||
output_resident_name( odp->name, i );
|
output_resident_name( odp->name, i );
|
||||||
|
@ -729,9 +730,9 @@ static void output_module16( DLLSPEC *spec )
|
||||||
output( "\t.long 0x%08x,0x%08x\n", arg_types[0], arg_types[1] );
|
output( "\t.long 0x%08x,0x%08x\n", arg_types[0], arg_types[1] );
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i <= spec->limit; i++)
|
for (i = 0; i <= exports->limit; i++)
|
||||||
{
|
{
|
||||||
ORDDEF *odp = spec->ordinals[i];
|
ORDDEF *odp = exports->ordinals[i];
|
||||||
if (!odp || !is_function( odp )) continue;
|
if (!odp || !is_function( odp )) continue;
|
||||||
output( ".L__wine_%s_%u:\n", spec->c_name, i );
|
output( ".L__wine_%s_%u:\n", spec->c_name, i );
|
||||||
output( "\tpushw %%bp\n" );
|
output( "\tpushw %%bp\n" );
|
||||||
|
@ -745,9 +746,9 @@ static void output_module16( DLLSPEC *spec )
|
||||||
|
|
||||||
output( "\n.L__wine_spec_data_segment:\n" );
|
output( "\n.L__wine_spec_data_segment:\n" );
|
||||||
output( "\t.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n" ); /* instance data */
|
output( "\t.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n" ); /* instance data */
|
||||||
for (i = 0; i <= spec->limit; i++)
|
for (i = 0; i <= exports->limit; i++)
|
||||||
{
|
{
|
||||||
ORDDEF *odp = spec->ordinals[i];
|
ORDDEF *odp = exports->ordinals[i];
|
||||||
if (!odp || odp->type != TYPE_VARIABLE) continue;
|
if (!odp || odp->type != TYPE_VARIABLE) continue;
|
||||||
output( ".L__wine_%s_%u:\n", spec->c_name, i );
|
output( ".L__wine_%s_%u:\n", spec->c_name, i );
|
||||||
output( "\t.long " );
|
output( "\t.long " );
|
||||||
|
|
Loading…
Add table
Reference in a new issue