From: Rutger O. <ov...@us...> - 2005-07-02 05:50:59
|
I am experiencing a strange problem with binutils and gcc 4 on win32. It does not seem to happen with gcc 3.4, nor on linux with 4.0. I'm just guessing that it is a binutils problem at this point in combination with something that gcj 4.0 is doing at -O1 and above but I'm not able to figure out what is truly going on. I have tried a self-compiled gcc4, as well as the gcc 4 from: http://www.thisiscool.com/gcc_mingw.htm http://www.thisiscool.net/gcc40-20050324.tar.bz2 I am using gcj, but I assume the same would happen with gcc if I could figure out how to create a testcase in C. The problem is that at -O1 or above, my apps are not seen by windows as valid executables. When compiled at -O0, they work fine. They are big apps. Simple test apps work fine at any -O level. I peeked into the resulting .exe, and the only thing that I notice to be different at -O1 and above is that the .rdata section has many entries. In a hex viewer, the .exe shows the .rdata section and a sequence of numbers: .rdata ... /4 ... /21 ... /38 .. /55 ... When this sequence of numbers exceeds /1500 or so, the .exe is no longer valid. Maybe I am on the wrong track, but it is consistent. What are these entries? Here is a sample test app: big.java (18k) http://s22.yousendit.com/d.aspx?id=1F8U0JOGB40PS26OXGDLEOAR6S Compile it with thisiscool gcj: /thisiscool-gcc/gcc-4.0/bin/gcj -O1 --main=big big.java -o big.java [] big big.exe is not a valid Win32 application. It is just a bunch of strings of increasing length. This seems to fill up the .rdata section. With less than 150 strings it works. At -O0 it works. More than 175 and -O1 or above and the .exe becomes invalid. I've tried many different versions of as/ld including the latest snapshot (2005/07/01). Hints or tips on what the problem might be (and a solution) would be greatly appreciated. Is it gcc, or binutils or something else? I'm stumped. Thanks! |