"Pierre d'Herbemont" stegefin@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.
On 20 nov. 03, at 04:50, Alexandre Julliard wrote:
"Pierre d'Herbemont" stegefin@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)
"Pierre d'Herbemont" stegefin@free.fr writes:
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.
I'd suggest using a bss symbol instead, the value should be close enough for what we need and it avoids the whole dyld mess. Replacing 'extern char _end[]' by 'static char _end[1]' should do the trick.