Commit 5fcc5d3f authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

winebuild: Refer to strings used in generated stubs by symbol rather than by…

winebuild: Refer to strings used in generated stubs by symbol rather than by offset to avoid problems when the compiler aligns the strings by 2 or more bytes.
parent f570fd31
...@@ -1177,14 +1177,14 @@ static void output_external_link_imports( DLLSPEC *spec ) ...@@ -1177,14 +1177,14 @@ static void output_external_link_imports( DLLSPEC *spec )
void output_stubs( DLLSPEC *spec ) void output_stubs( DLLSPEC *spec )
{ {
const char *name, *exp_name; const char *name, *exp_name;
int i, pos; int i, count;
if (!has_stubs( spec )) return; if (!has_stubs( spec )) return;
output( "\n/* stub functions */\n\n" ); output( "\n/* stub functions */\n\n" );
output( "\t.text\n" ); output( "\t.text\n" );
for (i = pos = 0; i < spec->nb_entry_points; i++) for (i = count = 0; i < spec->nb_entry_points; i++)
{ {
ORDDEF *odp = &spec->entry_points[i]; ORDDEF *odp = &spec->entry_points[i];
if (odp->type != TYPE_STUB) continue; if (odp->type != TYPE_STUB) continue;
...@@ -1202,9 +1202,9 @@ void output_stubs( DLLSPEC *spec ) ...@@ -1202,9 +1202,9 @@ void output_stubs( DLLSPEC *spec )
output( "1:" ); output( "1:" );
if (exp_name) if (exp_name)
{ {
output( "\tleal .L__wine_stub_strings+%d-1b(%%eax),%%ecx\n", pos ); output( "\tleal .L%s_string-1b(%%eax),%%ecx\n", name );
output( "\tpushl %%ecx\n" ); output( "\tpushl %%ecx\n" );
pos += strlen(exp_name) + 1; count++;
} }
else else
output( "\tpushl $%d\n", odp->ordinal ); output( "\tpushl $%d\n", odp->ordinal );
...@@ -1215,8 +1215,8 @@ void output_stubs( DLLSPEC *spec ) ...@@ -1215,8 +1215,8 @@ void output_stubs( DLLSPEC *spec )
{ {
if (exp_name) if (exp_name)
{ {
output( "\tpushl $.L__wine_stub_strings+%d\n", pos ); output( "\tpushl $.L%s_string\n", name );
pos += strlen(exp_name) + 1; count++;
} }
else else
output( "\tpushl $%d\n", odp->ordinal ); output( "\tpushl $%d\n", odp->ordinal );
...@@ -1226,17 +1226,20 @@ void output_stubs( DLLSPEC *spec ) ...@@ -1226,17 +1226,20 @@ void output_stubs( DLLSPEC *spec )
output_function_size( name ); output_function_size( name );
} }
if (pos) if (count)
{ {
output( "\t%s\n", get_asm_string_section() ); output( "\t%s\n", get_asm_string_section() );
output( ".L__wine_stub_strings:\n" );
for (i = 0; i < spec->nb_entry_points; i++) for (i = 0; i < spec->nb_entry_points; i++)
{ {
ORDDEF *odp = &spec->entry_points[i]; ORDDEF *odp = &spec->entry_points[i];
if (odp->type != TYPE_STUB) continue; if (odp->type != TYPE_STUB) continue;
exp_name = odp->name ? odp->name : odp->export_name; exp_name = odp->name ? odp->name : odp->export_name;
if (exp_name) if (exp_name)
{
name = get_stub_name( odp, spec );
output( ".L%s_string:\n", name );
output( "\t%s \"%s\"\n", get_asm_string_keyword(), exp_name ); output( "\t%s \"%s\"\n", get_asm_string_keyword(), exp_name );
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment