On Wed, 30 Dec 2009 00:44:08 +0100, Danny Backx <danny.ba...@scarlet.be>
wrote:
> On Tue, 2009-12-29 at 18:34 +0000, Pedro Alves wrote:
>> My knee jerk reaction is: you could try a first step at checking if
it's
>> a problem with loader applied relocations, or, if it's a runtime,
>> post loader problem.  Replace your debug '#if 0' by, say,
>> 
>> at global scope:
>> volatile int print_base = 0;
>> 
>> {
>> ...
>>   if (print_base)
>>     wsprintf(msg, L"Ptr %p", &__U(_image_base__));
>>   wsprintf(msg, L"Ptrs %p %p", &__RUNTIME_PSEUDO_RELOC_LIST__,
>>     &__RUNTIME_PSEUDO_RELOC_LIST_END__);
>> }
>> 
>> And see if that loads and runs.  Then try with print_base set to 1.
>> Build without optimizations.
> 
> In both cases, the output is the same :
> 
> LoadLibrary(lib5bb.dll) : cannot load DLL -> error 1114
> 
> I must admit I've been suspicious about the relocations, I guess this
> confirms it.
> 
> I've put up some data on
> http://danny.backx.info/download/cegcc/lib5bb.tar.gz :
> 
> pavilion: {1801} tar tvfz /tmp/lib5bb.tar.gz 
> -rw-rw-r-- danny/danny     822 2009-12-28 14:56 lib5b.c
> -rw-rw-r-- danny/danny    6175 2009-12-30 00:37 pseudo-reloc.c
> -rw-rw-r-- danny/danny    2476 2009-12-29 14:46 dllcrt1.c
> -rw-rw-r-- danny/danny    2935 2009-12-30 00:30 Makefile
> -rwxrwxr-x danny/danny   90906 2009-12-30 00:37 lib5bb.dll.works
> -rw-rw-r-- danny/danny  345371 2009-12-30 00:41 lib5bb.dll.works.objdump
> -rwxrwxr-x danny/danny   89594 2009-12-30 00:36 lib5bb.dll.fails
> -rw-rw-r-- danny/danny  342301 2009-12-30 00:41 lib5bb.dll.fails.objdump
> pavilion: {1802} 
> 
>       Danny

Some remarks, DLLs produced by cegcc have a weird IAT address because 
in Data Directories fields there is :

Virtual Address          Size
00033198              00000040

and this address doesn't even exists.


On a dll produced by Visual we get :
Virtual Address          Size
10003000              00000024

and 10003000 corresponds to the address of .data section.

Finally address are also suspicious because in old days (before all
binutils hacks) sections
had address like 10002000h, 10003000h,... but now it's more 00011000h,
00012000h,...
Is there any reason image_base has been modified ?











------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to