winegcc: Add support for specifying section alignment on Solaris.

This commit is contained in:
Alexandre Julliard 2008-07-22 13:27:07 +02:00
parent b24b2d584e
commit e468ab3585
1 changed files with 17 additions and 0 deletions

View File

@ -160,6 +160,7 @@ struct options
const char* wine_objdir;
const char* output_name;
const char* image_base;
const char* section_align;
strarray* prefix;
strarray* lib_dirs;
strarray* linker_args;
@ -640,6 +641,17 @@ static void build(struct options* opts)
}
#endif
#ifdef __sun
{
char *mapfile = get_temp_file( output_name, ".map" );
const char *align = opts->section_align ? opts->section_align : "0x1000";
create_file( mapfile, 0644, "text = A%s;\ndata = A%s;\n", align, align );
strarray_add(link_args, strmake("-Wl,-M,%s", mapfile));
strarray_add(tmp_files, mapfile);
}
#endif
for ( j = 0; j < lib_dirs->size; j++ )
strarray_add(link_args, strmake("-L%s", lib_dirs->base[j]));
@ -971,6 +983,11 @@ int main(int argc, char **argv)
opts.image_base = strdup( Wl->base[++j] );
continue;
}
if (!strcmp(Wl->base[j], "--section-alignment") && j < Wl->size - 1)
{
opts.section_align = strdup( Wl->base[++j] );
continue;
}
if (!strcmp(Wl->base[j], "-static")) linking = -1;
strarray_add(opts.linker_args, strmake("-Wl,%s",Wl->base[j]));
}