Commit 8aba0897 authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent ec9024ca
...@@ -188,6 +188,7 @@ extern const char *func_size( const char *func ); ...@@ -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_ptr_keyword(void);
extern const char *get_asm_string_keyword(void); extern const char *get_asm_string_keyword(void);
extern const char *get_asm_short_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_import_dll( const char *name, const char *filename );
extern void add_delayed_import( const char *name ); extern void add_delayed_import( const char *name );
......
...@@ -314,6 +314,7 @@ static void output_stubs( FILE *outfile, DLLSPEC *spec ) ...@@ -314,6 +314,7 @@ static void output_stubs( FILE *outfile, DLLSPEC *spec )
if (pos) if (pos)
{ {
fprintf( outfile, " \"\\t%s\\n\"\n", get_asm_string_section() );
fprintf( outfile, " \".L__wine_stub_strings:\\n\"\n" ); fprintf( outfile, " \".L__wine_stub_strings:\\n\"\n" );
for (i = 0; i < spec->nb_entry_points; i++) for (i = 0; i < spec->nb_entry_points; i++)
{ {
...@@ -453,19 +454,11 @@ void BuildSpec32File( FILE *outfile, DLLSPEC *spec ) ...@@ -453,19 +454,11 @@ void BuildSpec32File( FILE *outfile, DLLSPEC *spec )
if (target_platform == PLATFORM_APPLE) if (target_platform == PLATFORM_APPLE)
fprintf( outfile, "static char _end[4];\n" ); 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 */ /* Output the resources */
resources_size = output_resources( outfile, spec ); 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 */ /* Output the NT header */
fprintf( outfile, "#ifndef __GNUC__\n" ); fprintf( outfile, "#ifndef __GNUC__\n" );
...@@ -564,6 +557,12 @@ void BuildSpec32File( FILE *outfile, DLLSPEC *spec ) ...@@ -564,6 +557,12 @@ void BuildSpec32File( FILE *outfile, DLLSPEC *spec )
fprintf( outfile, " \"\\t.long 0,0\\n\"\n" ); /* DataDirectory[15] */ fprintf( outfile, " \"\\t.long 0,0\\n\"\n" ); /* DataDirectory[15] */
fprintf( outfile, ");\n" ); 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_stubs( outfile, spec );
output_exports( outfile, spec ); output_exports( outfile, spec );
output_imports( outfile, spec ); output_imports( outfile, spec );
......
...@@ -501,3 +501,12 @@ const char *get_asm_short_keyword(void) ...@@ -501,3 +501,12 @@ const char *get_asm_short_keyword(void)
default: return ".short"; default: return ".short";
} }
} }
const char *get_asm_string_section(void)
{
switch (target_platform)
{
case PLATFORM_APPLE: return ".cstring";
default: return ".section .rodata";
}
}
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