On Wed, 2009-12-09 at 15:31 +0100, Vincent R. wrote:
> > It reminds me what was reported the first time someone talked about
> issue
> > between cegcc and Windows Mobile 6.1.
> > In this initial report there was something about the size and under some
> > value, it was working fine.
> > 
> 
> Here is extract of the original post :
> 
> "I tried to modify binutils/bfd/peXXigen.c to have .idata without write
> attribute and my previous test case is loading successfully. But if I
> compile with all the CRT stuff (a DLL with DllMainCRTStartup), the
> application crash at load. When looking at the crash, the problem is
> that only the first 64kB is loaded and DllMainCRTStartup try to call a
> function after those 64kB, causing a page exception. Compiling without
> the CRT stuff load all the code. I'm searching why there is such a
> difference."
> 
> Now I don't know if it's the same thing you are talking about.

Thanks for reminding me of these, I had almost forgotten. I'll do more
tests on this.

What I find odd is :
- those mails all talk about a change happening when SizeOfImage>10000
- a number of websites talk about 64KB boundaries (which is the same
  number, but maybe not the same variable)
- I found a change when text segment size hit 0x1000 which is 4K

> please try to upx your binaries and check if it still doesn't work.
> Just curious to know the result.

Running upx on lib2.dll does make it work on the emulator. Or at least,
testapi can now load it. Haven't tried more, this is not really a useful
DLL, I'm afraid.

The new DLL causes objdump to generate an error message. It also shows
only 3 sections, not sure how reliable this is though (haven't looked at
a hex dump) :

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 UPX0          00010000  00011000  00011000  00000000  2**2
                  ALLOC, CODE
  1 UPX1          00001e00  00021000  00021000  00000200  2**2
                  CONTENTS, ALLOC, LOAD, CODE, DATA
  2 UPX2          00000200  00023000  00023000  00002000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
arm-mingw32ce-objdump: lib2.dll: File truncated

One of my ideas is that the mere number of sections of some type (CODE,
LOAD, DATA ?) might be a differentiator. This is in line with your
original assessment that .edata and .idata have to be absorbed
into .data or so.

Some more strangeness :
pavilion: {13} arm-mingw32ce-size orig/lib2.dll lib2.dll
   text    data     bss     dec     hex filename
   4933     500       0    5433    1539 orig/lib2.dll
  73728       0       0   73728   12000 lib2.dll
pavilion: {14} ls -l orig/lib2.dll lib2.dll
-rwxrwxr-x 1 danny danny 19254 2009-12-11 17:41 lib2.dll
-rwxrwxr-x 1 danny danny 33078 2009-12-11 17:30 orig/lib2.dll

the file size goes down but the section sizes don't. But this output may
suffer from the same problem as objdump - may not be reliable info.

        Danny
-- 
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to