[Darwine] Re: Re Winebuild : Fix spec32 file generation for Darwin

emmanuel maillard e.rsz at libertysurf.fr
Mon Apr 19 18:31:25 CDT 2004


init() fini() and end are not part of mach-o.
Initialisation are already call by dlopen and previous version
from pierre make recall initialisation stuff for all dlls each time you 
load one.
So __wine_register_dll_16 failed due to assertion.

SizeOfImge can be compute like this : 
-------------- next part --------------
char *addr;
stracut mach_header machHeader;
struct load_command *loadCmd;
struct segment_command *segmentCmd;

char dllName[MAXPATHLEN];
unsigned long i;
unsigned long count = _dyld_image_count();
unsigned long offset;

sprintf(dllName, \"%s\", %s /* spec->file_name */);

for( i=0; i < count); i++)
    if(_dyld_get_image_name(i), dllName)
    {
	unsigned long j;
	machHeader = _dyld_get_image_header(i);
	addr = (char *) machHeader;
	offset = sizeof(struct mach_header);

	for (j = 0; j < machHeader->ncmds; i++)
	{
	    loadCmd = (struct load_command *) (addr + offset);
	    if (loadCmd->cmd != LC_SEGMENT)
	    {
		offset += loadCmd->cmdsize;
		continue;
	    }
	    segmentCmd = (struct segment_command *) (addr + offset);
	    nt_header.OptionalHeader.SizeOfImage += segmentCmd->vmsize;
	    offset += loadCmd->cmdsize;
	}
    }
    
__wine_dll_register( &nt_header, %s );
-------------- next part --------------


if you want i'll add this for computing image size.

emmanuel

Le 19 avr. 04, ? 23:35, Alexandre Julliard a ?crit :

> emmanuel maillard <e.rsz at libertysurf.fr> writes:
>
>> Sorry my previous mail include a broken patch
>> This one is the good one.
>>
>> Changelog :
>> 	Fix spec32 file generation for Darwin
>
> Why are you removing the init code and the SizeOfImage thing?  This
> doesn't look right at all.
>
> -- 
> Alexandre Julliard
> julliard at winehq.org
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> Darwine-devel mailing list
> Darwine-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/darwine-devel
>



More information about the wine-devel mailing list