Interesting Behavior of OS X

Steven Edwards winehacker at gmail.com
Thu Nov 29 07:47:27 CST 2007


Hi Again,

On Nov 29, 2007 5:37 AM, Steven Edwards <winehacker at gmail.com> wrote:
> Is Apple going to be adding a win32 compatibility layer to OS X?

This is the most important question to me because of some information Ken found:

I don't know that this whole thing amounts to anything, but thought
I'd add a few notes.

This is new to Leopard.  On Tiger, dlopen rejects PE files as
expected.  The Wine testing that Steven was originally trying to do
would probably not crash on Tiger.  Wine needs a patch to somehow
check that a file is actually a Mach-O object file before calling
dlopen on it.

There really are PE-loading smarts somewhere within the Mac OS X
dynamic loader (dyld).  If you set DYLD_PRINT_SEGMENTS=1 before
running Steven's sample program, you'll get something like this in
the output:

dyld: Main executable mapped /private/tmp/a.out
         __PAGEZERO at 0x00000000->0x00001000
             __TEXT at 0x00001000->0x00002000
             __DATA at 0x00002000->0x00003000
           __IMPORT at 0x00003000->0x00004000
         __LINKEDIT at 0x00004000->0x00005000
[...]
dyld: Mapping /private/tmp/procexp.exe
            .header at 0x400000->0x400fff with permissions rw.
              .text at 0x401000->0x47155b with permissions rw.
             .rdata at 0x472000->0x481933 with permissions rw.
              .data at 0x482000->0x4a3deb with permissions rw.
              .rsrc at 0x4a4000->0x7819df with permissions rw.


The diagnostics printed for the loading of a.out are typical of a
Mach-O object.  Those for procexp.exe are definitely not.

So, there you have it.

-Ken

PE Files were rejected on Tiger, which is interesting to me because I don't
think that this is just a hold over from EFI support. I think it may be a sign
of future addition of a Win32 subsystem to OS X.

-- 
Steven Edwards

"There is one thing stronger than all the armies in the world, and
that is an idea whose time has come." - Victor Hugo



More information about the wine-devel mailing list