[PATCH] winegcc: Align sections in PE files to page size.

Jacek Caban jacek at codeweavers.com
Mon Jul 13 10:28:24 CDT 2020


Hi Rémi,

On 13.07.2020 16:41, Rémi Bernon wrote:
> This makes sure it will be possible to mmap the section directly instead
> of having to copy them. It then also makes perf able to figure the code
> origin for Wine modules.
>
> Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
> ---
>
> I'm resending just this one as I am now trying to upstream PE support
> directly in Linux perf. This should still be useful to avoid copying
> sections when Wine modules are loaded.
>
>   tools/winegcc/winegcc.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
> index 29c1b0549d3..24da839fd83 100644
> --- a/tools/winegcc/winegcc.c
> +++ b/tools/winegcc/winegcc.c
> @@ -547,6 +547,9 @@ static strarray *get_link_args( struct options *opts, const char *output_name )
>           else if (!opts->strip)
>               strarray_add(link_args, "-Wl,-debug:dwarf");
>   
> +        if (!try_link( opts->prefix, link_args, "-Wl,--file-alignment:0x1000"))
> +            strarray_add( link_args, "-Wl,--file-alignment:0x1000" );
> +


This can't work, I think you meant to do that for PLATFORM_MINGW instead.


Thanks,

Jacek




More information about the wine-devel mailing list