_end Symbol and Mac OS X

Pierre d'Herbemont stegefin at free.fr
Thu Nov 20 14:04:02 CST 2003


On 20 nov. 03, at 04:50, Alexandre Julliard wrote:

> "Pierre d'Herbemont" <stegefin at free.fr> writes:
>
>> On Mac OS X There is no _end symbol. There is a convenience function
>> get_end() to replace it, mainly because of the Mach-O file format. So
>> we have to get the value of get_end at launch time and store it in the
>> nt_header.
>
> Does get_end really return the _end value of the current library?
> I suspect it returns the value for the main executable in all cases,
> which is not what we need here.
>

You are right. Thanks. I'll resend a patch. But I think it will become 
a little more complicated, there seems to be no simple way to do it 
with the Mac OS X's Mach-O Functions. here is a snapshot of what it 
should be if any interest:

void __wine_spec_ntdll_dll_init(void)
{
     extern void __wine_dll_register( const struct image_nt_headers *, 
const char * );
     extern void *__wine_dbg_register( char * const *, int );
      extern unsigned long _dyld_image_count(void);
     extern int strstr(const char *, const char *);
     unsigned long i;
     for( i=0; i<_dyld_image_count(); i++)
         if(strstr(_dyld_get_image_name(i), "ntdll.dll")) break;

     nt_header.OptionalHeader.SizeOfImage = 
_dyld_get_image_size_function_which_does_not_exists(i);
     __wine_dll_register( &nt_header, "ntdll.dll" );
}

I'll look deeper before my next try. I'll also try to see if there is a 
way to implement such a function directly in the darwin's code too.

Thanks

Pierre

(PS : Thank you, Mike for your last answer)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 2946 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20031120/f1622a5c/attachment.bin


More information about the wine-devel mailing list