Commit 124eaf80 authored by Alexandre Julliard's avatar Alexandre Julliard

Builtin modules must be aligned on 64K boundary.

parent 94fa372b
...@@ -220,18 +220,9 @@ static void *map_dll( const IMAGE_NT_HEADERS *nt_descr ) ...@@ -220,18 +220,9 @@ static void *map_dll( const IMAGE_NT_HEADERS *nt_descr )
assert( size <= page_size ); assert( size <= page_size );
if (nt_descr->OptionalHeader.ImageBase) /* module address must be aligned on 64K boundary */
{ addr = (BYTE *)((nt_descr->OptionalHeader.ImageBase + 0xffff) & ~0xffff);
addr = wine_anon_mmap( (void *)nt_descr->OptionalHeader.ImageBase, if (wine_anon_mmap( addr, page_size, PROT_READ|PROT_WRITE, MAP_FIXED ) != addr) return NULL;
page_size, PROT_READ|PROT_WRITE, MAP_FIXED );
if (addr != (BYTE *)nt_descr->OptionalHeader.ImageBase) return NULL;
}
else
{
/* this will leak memory; but it should never happen */
addr = wine_anon_mmap( NULL, page_size, PROT_READ|PROT_WRITE, 0 );
if (addr == (BYTE *)-1) return NULL;
}
dos = (IMAGE_DOS_HEADER *)addr; dos = (IMAGE_DOS_HEADER *)addr;
nt = (IMAGE_NT_HEADERS *)(dos + 1); nt = (IMAGE_NT_HEADERS *)(dos + 1);
......
...@@ -550,7 +550,7 @@ void BuildSpec32File( FILE *outfile ) ...@@ -550,7 +550,7 @@ void BuildSpec32File( FILE *outfile )
fprintf( outfile, "#endif\n" ); fprintf( outfile, "#endif\n" );
fprintf( outfile, "asm(\".section \\\".text\\\"\\n\\t\"\n" ); fprintf( outfile, "asm(\".section \\\".text\\\"\\n\\t\"\n" );
fprintf( outfile, " \".align %d\\n\"\n", get_alignment(page_size) ); fprintf( outfile, " \".align %d\\n\"\n", get_alignment(page_size) );
fprintf( outfile, " \"" __ASM_NAME("pe_header") ":\\t.skip %ld\\n\\t\");\n", page_size ); fprintf( outfile, " \"" __ASM_NAME("pe_header") ":\\t.skip 65536\\n\\t\");\n" );
fprintf( outfile, "#ifndef __GNUC__\n" ); fprintf( outfile, "#ifndef __GNUC__\n" );
fprintf( outfile, "}\n" ); fprintf( outfile, "}\n" );
fprintf( outfile, "#endif\n" ); fprintf( outfile, "#endif\n" );
......
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