How to fix SizeOfImage when loading a builtin dll ?
laurent.pinchart at skynet.be
Wed May 29 04:21:18 CDT 2002
>>I noticed that, when a builtin dll (.so) is loaded, the SizeOfImage field in
>>the OptionalHeader is not updated and stays equal to page_size (see
>>I need to get the correct value in SizeOfImage.
>>I thought about updating that field in map_dll at library/loader.c, but don't
>>know how to get the size of the image.
>>Could anyone help me ? I'm not familiar with the PE loader.
>You can't find out the size of the image from the libdl API calls
>except going into heavy ELF parsing.
>winebuild does not really know either.
>My suggestion would be to use a heuristic like the one below. However
>it is not perfect, the sizes are too large sometimes.
I thought about modifying winebuild to add
nt_headers->OptionalHeader.SizeOfImage = pe_header - _end;
in the library initialisation function. This is small, fast and probably
Does anyone have any comment about that ?
More information about the wine-devel