winegc: Support overriding the default PE file alignment.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
e36bed4f37
commit
0e4d22bd8d
|
@ -223,6 +223,7 @@ struct options
|
||||||
const char* output_name;
|
const char* output_name;
|
||||||
const char* image_base;
|
const char* image_base;
|
||||||
const char* section_align;
|
const char* section_align;
|
||||||
|
const char* file_align;
|
||||||
const char* sysroot;
|
const char* sysroot;
|
||||||
const char* isysroot;
|
const char* isysroot;
|
||||||
const char* lib_suffix;
|
const char* lib_suffix;
|
||||||
|
@ -522,7 +523,8 @@ static strarray *get_link_args( struct options *opts, const char *output_name )
|
||||||
strarray_add(link_args, strmake("-Wl,-pdb,%s", opts->debug_file));
|
strarray_add(link_args, strmake("-Wl,-pdb,%s", opts->debug_file));
|
||||||
|
|
||||||
if (!try_link( opts->prefix, link_args, "-Wl,--file-alignment,0x1000" ))
|
if (!try_link( opts->prefix, link_args, "-Wl,--file-alignment,0x1000" ))
|
||||||
strarray_add( link_args, "-Wl,--file-alignment,0x1000" );
|
strarray_add( link_args, strmake( "-Wl,--file-alignment,%s",
|
||||||
|
opts->file_align ? opts->file_align : "0x1000" ));
|
||||||
|
|
||||||
strarray_addall( link_args, flags );
|
strarray_addall( link_args, flags );
|
||||||
return link_args;
|
return link_args;
|
||||||
|
@ -1918,6 +1920,11 @@ int main(int argc, char **argv)
|
||||||
opts.section_align = strdup( Wl->base[++j] );
|
opts.section_align = strdup( Wl->base[++j] );
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!strcmp(Wl->base[j], "--file-alignment") && j < Wl->size - 1)
|
||||||
|
{
|
||||||
|
opts.file_align = strdup( Wl->base[++j] );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!strcmp(Wl->base[j], "--large-address-aware"))
|
if (!strcmp(Wl->base[j], "--large-address-aware"))
|
||||||
{
|
{
|
||||||
opts.large_address_aware = 1;
|
opts.large_address_aware = 1;
|
||||||
|
|
Loading…
Reference in New Issue