This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bad executable and stripped/unstripped exes


Guenther was kind enough to send me an executable that doesn't work. The
problem seems to be that the sections of the executable are not in
ascending order:
We have First text, bss and data sections. So far all OK.
text is at 4096    0x1000
bss is at  8192    0x2000
data is at 12288   0x3000

then we have the .stab and the .stabstr sections.
.stab at    24576  0x6000
.stabstr at 28672  0x7000

and THEN the resources section.
.rsrc at    20480  0x5000

The system expects a contiguous image. Since the type of the debug info
is 'NOT LOADABLE' this would leave a hole in the image and the system refuses
to load a thing like that.

Fixes:
1 Change the type of the stabs section from 'NOT LOADABLE' to LOADABLE.
  This horrible hack would multiply your memory consumption with a lot of
  strings like:
  /pizza/mushroom/noer/beta17/build and many other funny things... (By the
  way noer, we all know you like mushroom pizza by now... I think it is NOT
  necessary to write it in all executables produced by gcc...:-)
  The debug section would be loaded into memory, but since there are no
  pointers to it this would be harmless. Of course, instead of having a
  memory usage of say, 300K, your program would occupy maybe 3MB.
2 Fix ld. The resources section should come after the data section in the
  header. This is a MAJOR undertaking however. But I have an idea.
  

Since Cygnus sells support of gcc, I can sell support of 'ld' to Cygnus
isn't it?

Dear Cygnus people: I do not have a penny and I would like to have some
money to buy ... say mushroom pizza. (I know you will understand this).
So please make me an offer and I'll fix all your 'ld' misgivings.

Yours sincerely
-- 
Jacob Navia	Logiciels/Informatique
41 rue Maurice Ravel			Tel 01 48.23.51.44
93430 Villetaneuse 			Fax 01 48.23.95.39
France
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]