Ge van Geldorp ge@gse.nl writes:
Changelog: Ge van Geldorp ge@gse.nl
- Allow relocation on x86_64
Is that really needed for Win64? And if so, shouldn't it use a more appropriate address?
From: Alexandre Julliard [mailto:julliard@winehq.org]
Changelog: Ge van Geldorp ge@gse.nl
- Allow relocation on x86_64
Is that really needed for Win64? And if so, shouldn't it use a more appropriate address?
The standard load address for 64-bit PE executables is the same as for 32-bit, 0x400000. This is also the standard load address for 64-bit ELF executables. If the Wine loader is not relocated, it won't be able to load the majority of PE executables. Ofcourse, there's no problem with 64-bit Winelib executables. As to the more appropriate address, I'm not sure. I just wanted to get it out of the way. I suppose it could be moved to somewhere around or above 0x7bf0000000000000.
Ge van Geldorp.
"Ge van Geldorp" ge@gse.nl writes:
The standard load address for 64-bit PE executables is the same as for 32-bit, 0x400000. This is also the standard load address for 64-bit ELF executables. If the Wine loader is not relocated, it won't be able to load the majority of PE executables. Ofcourse, there's no problem with 64-bit Winelib executables. As to the more appropriate address, I'm not sure. I just wanted to get it out of the way. I suppose it could be moved to somewhere around or above 0x7bf0000000000000.
The appropriate address needs to be determined from the standard Win64 address space layout. I don't have a Win64 box to check what this looks like though.
From: Alexandre Julliard [mailto:julliard@winehq.org]
The appropriate address needs to be determined from the standard Win64 address space layout. I don't have a Win64 box to check what this looks like though.
Ok, I need some guidance on this. This is the usermode address space layout when running a simple Win64 app:
0000000000010000 - 0000000000011000 commit private
0000000000020000 - 0000000000021000 commit private
0000000000030000 - 000000000012C000 reserve private 000000000012C000 - 000000000012E000 commit private 000000000012E000 - 0000000000130000 commit private stack 0000000000130000 - 0000000000135000 commit mapped
0000000000140000 - 0000000000141000 commit mapped
0000000000150000 - 0000000000156000 commit private process heap
0000000000250000 - 0000000000254000 commit mapped 0000000000254000 - 0000000000260000 reserve mapped 0000000000260000 - 0000000000276000 commit mapped
0000000000280000 - 00000000002B4000 commit mapped
00000000002C0000 - 0000000000301000 commit mapped
0000000000310000 - 0000000000316000 commit mapped
0000000000320000 - 0000000000330000 commit private 0000000000330000 - 0000000000333000 commit mapped
0000000000400000 - 000000000048E000 commit image application
0000000000490000 - 00000000004B1000 commit private 00000000004B1000 - 0000000000590000 reserve private
0000000078D40000 - 0000000078EB2000 commit image kernel32.dll
0000000078EC0000 - 0000000078ff9000 commit image ntdll.dll
000000007EFE0000 - 000000007EFE9000 commit mapped 000000007EFE9000 - 000000007F0E0000 reserve mapped 000000007F0E0000 - 000000007FFE0000 reserve private 000000007FFE0000 - 000000007FFE1000 commit private shared user page 000000007FFE1000 - 000000007FFF0000 reserve private
000007FFFFFB0000 - 000007FFFFFD4000 commit mapped
000007FFFFFDD000 - 000007FFFFFDF000 commit private TEB 000007FFFFFDF000 - 000007FFFFFE0000 commit private PEB 000007FFFFFE0000 - 000007FFFFFF0000 reserve private
Some of the commit/mapped areas contain NLS files. As far as I can tell, the TEB and PEB were moved from just-below-2GB to just-below-7TB, while the shared user page and system DLLs like kernel32 and ntdll were kept at just-below-2GB. I think 0x7bf00400 as relocation address for the Wine loader would work fine. If you'd rather see a different load address or want me to investigate something else please let me know.
Ge van Geldorp.
"Ge van Geldorp" ge@gse.nl writes:
Some of the commit/mapped areas contain NLS files. As far as I can tell, the TEB and PEB were moved from just-below-2GB to just-below-7TB, while the shared user page and system DLLs like kernel32 and ntdll were kept at just-below-2GB. I think 0x7bf00400 as relocation address for the Wine loader would work fine. If you'd rather see a different load address or want me to investigate something else please let me know.
Yes, it looks like the existing address would work fine. Thanks for checking this.