wine_main_preload_info not found, cannot use first megabyte, *.exe don't work

Pavel Roskin proski at gnu.org
Mon Jul 31 00:11:06 CDT 2006


Hi Mike,

I have found a workaround!

On Mon, 2006-07-31 at 00:23 -0400, Pavel Roskin wrote: 
> I agree.  My gdb cannot show variables in 32-bit binaries (or maybe it's
> just something Wine specific), but it shows the line numbers.  I traced
> find_symbol() in preloader.c, and it seems like symtabend is 0, so that
> the last loop is skipped and NULL is returned.  This is also evidenced
> by the lack of "Found" in the log I sent in the previous message.

Adding more debug information confirms that:

dyn->d_tag=00000001 dyn->d_un.d_ptr=00000001
dyn->d_tag=00000001 dyn->d_un.d_ptr=00000094
dyn->d_tag=00000001 dyn->d_un.d_ptr=00000179
dyn->d_tag=0000000f dyn->d_un.d_ptr=000001c1
dyn->d_tag=0000000c dyn->d_un.d_ptr=7bf00b94
dyn->d_tag=0000000d dyn->d_un.d_ptr=7bf0123c
dyn->d_tag=6ffffef5 dyn->d_un.d_ptr=7bf00434
dyn->d_tag=00000005 dyn->d_un.d_ptr=7bf00770
dyn->d_tag=00000006 dyn->d_un.d_ptr=7bf004e0
dyn->d_tag=0000000a dyn->d_un.d_ptr=0000027f
dyn->d_tag=0000000b dyn->d_un.d_ptr=00000010
dyn->d_tag=00000015 dyn->d_un.d_ptr=00000000
dyn->d_tag=00000003 dyn->d_un.d_ptr=7bf023bc
dyn->d_tag=00000002 dyn->d_un.d_ptr=000000b0
dyn->d_tag=00000014 dyn->d_un.d_ptr=00000011
dyn->d_tag=00000017 dyn->d_un.d_ptr=7bf00ae4
dyn->d_tag=00000011 dyn->d_un.d_ptr=7bf00ad4
dyn->d_tag=00000012 dyn->d_un.d_ptr=00000010
dyn->d_tag=00000013 dyn->d_un.d_ptr=00000008
dyn->d_tag=6ffffffe dyn->d_un.d_ptr=7bf00a44
dyn->d_tag=6fffffff dyn->d_un.d_ptr=00000003
dyn->d_tag=6ffffff0 dyn->d_un.d_ptr=7bf009f0
DT_HASH=00000004
symtab=7bf004e0 strings=7bf00770 symtabend=00000000
wine_main_preload_info not found

find_symbol() looks for DT_HASH (4) to set symtabend and fails to find
it.  As I understand it, we should trick ld into creating the DT_HASH
tag or use some other way to locate wine_main_preload_info.

The 6ffffef5 tag is DT_GNU_HASH - that may be a good alternative to
DT_HASH.  Adding -Wl,--hash-style=sysv to the gcc flags when linking
wine-pthread solves the problem!!!

I think adding support for DT_GNU_HASH would be a good idea anyway.

-- 
Regards,
Pavel Roskin





More information about the wine-devel mailing list