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.
Robert Shearman
rob at codeweavers.com
Wed Apr 25 02:51:44 CDT 2007
---
tools/winebuild/import.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
I've seen incorrect stub strings on both Mac OS X and Linux.
-------------- next part --------------
diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c
index 44c7802..9021cae 100644
--- a/tools/winebuild/import.c
+++ b/tools/winebuild/import.c
@@ -1202,7 +1202,7 @@ void output_stubs( DLLSPEC *spec )
output( "1:" );
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" );
pos += strlen(exp_name) + 1;
}
@@ -1215,7 +1215,7 @@ void output_stubs( DLLSPEC *spec )
{
if (exp_name)
{
- output( "\tpushl $.L__wine_stub_strings+%d\n", pos );
+ output( "\tpushl $.L%s_string\n", name );
pos += strlen(exp_name) + 1;
}
else
@@ -1229,14 +1229,17 @@ void output_stubs( DLLSPEC *spec )
if (pos)
{
output( "\t%s\n", get_asm_string_section() );
- output( ".L__wine_stub_strings:\n" );
for (i = 0; i < spec->nb_entry_points; i++)
{
ORDDEF *odp = &spec->entry_points[i];
if (odp->type != TYPE_STUB) continue;
exp_name = odp->name ? odp->name : odp->export_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 );
+ }
}
}
}
More information about the wine-patches
mailing list