Output constant strings in a more appropriate section than .text.

This commit is contained in:
Alexandre Julliard 2005-09-14 19:18:05 +00:00
parent ec9024cad3
commit 8aba0897bd
3 changed files with 17 additions and 8 deletions

View File

@ -188,6 +188,7 @@ extern const char *func_size( const char *func );
extern const char *get_asm_ptr_keyword(void);
extern const char *get_asm_string_keyword(void);
extern const char *get_asm_short_keyword(void);
extern const char *get_asm_string_section(void);
extern void add_import_dll( const char *name, const char *filename );
extern void add_delayed_import( const char *name );

View File

@ -314,6 +314,7 @@ static void output_stubs( FILE *outfile, DLLSPEC *spec )
if (pos)
{
fprintf( outfile, " \"\\t%s\\n\"\n", get_asm_string_section() );
fprintf( outfile, " \".L__wine_stub_strings:\\n\"\n" );
for (i = 0; i < spec->nb_entry_points; i++)
{
@ -453,19 +454,11 @@ void BuildSpec32File( FILE *outfile, DLLSPEC *spec )
if (target_platform == PLATFORM_APPLE)
fprintf( outfile, "static char _end[4];\n" );
else
fprintf( outfile, "extern char _end[];\n" );
fprintf( outfile, "const char __wine_spec_file_name[] = \"%s\";\n", spec->file_name );
/* Output the resources */
resources_size = output_resources( outfile, spec );
/* Output the entry point function */
fprintf( outfile, "extern void %s();\n\n", spec->init_func );
/* Output the NT header */
fprintf( outfile, "#ifndef __GNUC__\n" );
@ -564,6 +557,12 @@ void BuildSpec32File( FILE *outfile, DLLSPEC *spec )
fprintf( outfile, " \"\\t.long 0,0\\n\"\n" ); /* DataDirectory[15] */
fprintf( outfile, ");\n" );
fprintf( outfile, "asm(\"%s\\n\"\n", get_asm_string_section() );
fprintf( outfile, " \"\\t.globl %s\\n\"\n", asm_name("__wine_spec_file_name") );
fprintf( outfile, " \"%s:\\n\"\n", asm_name("__wine_spec_file_name"));
fprintf( outfile, " \"\\t%s \\\"%s\\\"\\n\"\n", get_asm_string_keyword(), spec->file_name );
fprintf( outfile, ");\n" );
output_stubs( outfile, spec );
output_exports( outfile, spec );
output_imports( outfile, spec );

View File

@ -501,3 +501,12 @@ const char *get_asm_short_keyword(void)
default: return ".short";
}
}
const char *get_asm_string_section(void)
{
switch (target_platform)
{
case PLATFORM_APPLE: return ".cstring";
default: return ".section .rodata";
}
}