<div dir="ltr">On Mon, Feb 16, 2015 at 4:47 AM, Tijl Coosemans <span dir="ltr"><<a href="mailto:tijl@freebsd.org" target="_blank">tijl@freebsd.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">On Tue, 3 Feb 2015 10:16:33 +0100 Tijl Coosemans <tijl@FreeBSD.org> wrote:<br>
> On Mon, 02 Feb 2015 22:20:57 +0200 David Naylor <<a href="mailto:dbn@freebsd.org">dbn@freebsd.org</a>> wrote:<br>
>> FreeBSD prefers to use a 0x200000 (super) page alignment however this<br>
>> causes the image base to be displaced from the requested 0x7b800000.<br>
>> Forcing a smaller page size ensures FreeBSD can place the image starting<br>
>> at 0x7b800000.<br>
><br>
> Just to clarify, the output of "readelf -l <a href="http://kernel32.dll.so" target="_blank">kernel32.dll.so</a>" gives this:<br>
<br>
</span>Can somebody run this command on Linux with <a href="http://kernel32.dll.so" target="_blank">kernel32.dll.so</a> from a<br>
wine64 build and post the output?  FreeBSD also uses GNU binutils so I<br>
would expect the problem to exist on Linux as well.<br>
<div class=""><div class="h5"><br>
>   Type Offset   VirtAddr   PhysAddr   FileSiz  MemSiz   Flg Align<br>
>   LOAD 0x000000 0x7b800000 0x7b800000 0x0c9e74 0x0c9e74 R E 0x200000<br>
>   LOAD 0x0ca000 0x7baca000 0x7baca000 0x1a7eb0 0x1a8550 RW  0x200000<br>
><br>
> The segments have an alignment of 0x200000 bytes.  This places the first<br>
> segment at 0x7b800000 and the second at 0x7ba00000+Offset.  With a<br>
> MemSiz of 0x1a8550 this pushes the second segment over 0x7bc00000 where<br>
> ntdll has been mapped already so loading kernel32 at 0x7b800000 fails.<br>
><br>
> The patch forces a smaller alignment so the second segment fits below<br>
> 0x7bc00000.<br></div></div></blockquote><div><br></div><div>This is from wine-1.7.34:<br>[austin@localhost ~]$ readelf -l /opt/wine6432/wine-1.7.34/lib64/wine/<a href="http://kernel32.dll.so">kernel32.dll.so</a> <br><br>Elf file type is DYN (Shared object file)<br>Entry point 0x7b827080<br>There are 7 program headers, starting at offset 64<br><br>Program Headers:<br>  Type           Offset             VirtAddr           PhysAddr<br>                 FileSiz            MemSiz              Flags  Align<br>  LOAD           0x0000000000000000 0x000000007b800000 0x000000007b800000<br>                 0x00000000000ce49c 0x00000000000ce49c  R E    200000<br>  LOAD           0x00000000000cf3c8 0x000000007bacf3c8 0x000000007bacf3c8<br>                 0x00000000001a8088 0x00000000001a8828  RW     200000<br>  DYNAMIC        0x00000000000cfd88 0x000000007bacfd88 0x000000007bacfd88<br>                 0x00000000000001e0 0x00000000000001e0  RW     8<br>  NOTE           0x00000000000001c8 0x000000007b8001c8 0x000000007b8001c8<br>                 0x0000000000000024 0x0000000000000024  R      4<br>  GNU_EH_FRAME   0x00000000000ac1c0 0x000000007b8ac1c0 0x000000007b8ac1c0<br>                 0x0000000000004a44 0x0000000000004a44  R      4<br>  GNU_STACK      0x0000000000000000 0x0000000000000000 0x0000000000000000<br>                 0x0000000000000000 0x0000000000000000  RW     10<br>  GNU_RELRO      0x00000000000cf3c8 0x000000007bacf3c8 0x000000007bacf3c8<br>                 0x0000000000000c38 0x0000000000000c38  R      1<br><br> Section to Segment mapping:<br>  Segment Sections...<br>   00     .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.dyn .rela.plt .init .plt .text .fini .rodata .eh_frame_hdr .eh_frame <br>   01     .init_array .fini_array .jcr .<a href="http://data.rel.ro">data.rel.ro</a> .dynamic .got .got.plt .data .bss <br>   02     .dynamic <br>   03     .note.gnu.build-id <br>   04     .eh_frame_hdr <br>   05     <br>   06     .init_array .fini_array .jcr .<a href="http://data.rel.ro">data.rel.ro</a> .dynamic .got <br>[austin@localhost ~]$ file /opt/wine6432/wine-1.7.34/lib64/wine/<a href="http://kernel32.dll.so">kernel32.dll.so</a><br>/opt/wine6432/wine-1.7.34/lib64/wine/<a href="http://kernel32.dll.so">kernel32.dll.so</a>: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=5769ec1e68c8f3e7445f1b2370d457a52d3507f4, not stripped<br><br> <br></div></div>-- <br><div class="gmail_signature">-Austin</div>
</div></div>