Hello, > DWORD SizeOfImage > This appears to be the total size of the portions of the image > that the loader has to worry about. It is the size of the region > starting at the image base up to the end of the last section. > The end of the last section is rounded up to the nearest > multiple of the section alignment. > > Could the generated headers be inconsistent ? Is there a way to get a > Microsoft utility (an equivalent of objdump or so) to inspect the > executable created by cegcc ? Or the other way around - inspection with > objdump of the difference between the headers created by Visual Studio > and cegcc.
I did a few tries to compare the two DLLs, with no success. Here is what I can see : - cegcc always emit an import table, even if there are no imported functions, while Visual doesn't, - if cegcc DLL has no import functions and I remove the import table (in Data Directories structure and .idata), the DLL will load successfully, - when the DLL contains external functions, we cannot simply delete the import table. Visual emits only a .rdata section containing the import table and export table. cegcc emits two sections, .idata for import table and .edata for export table. I didn't try for now to combine those two sections in just a .rdata section (I lack some gcc/ld/binutils guruness to hack ldscripts). - cegcc .idata is of characteristics C0300040 and .edata has 40300040 while Visual .rdata is 40000040. Changing cegcc .idata and .edata characteristics to 40000040 results is crashes in the loading (maybe the WM loader crash…) - changing subsystem, image and linker versions doesn't change anything. BTW, I just discovered that in WM6.1, non XIP DLL larger than 64k are now loaded in memory slot 60 (http://bolingconsulting.com/blog/?p=4). Does anyone knows how a call to a DLL function is redirected to the correct place ? Best regards, -- Jérôme Decoodt ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Cegcc-devel mailing list Cegcc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cegcc-devel