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]

Re: Bad executable and stripped/unstripped exes


root wrote:

  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.
  ...

It must be something else. Last night I compiled the GNU compiler tools
with
mingw32 (it was much less effort than you would expect to get it
working) and
voila - gcc produced executables which
- run without being stripped even under NT 4.0
- can even contain resources
- can even be debugged with gdb

Interesting, isn't it?

--

Gunther Ebert
iXOS Anwendungs-Software GmbH
Angerstrasse 40-42
D-04177 Leipzig

Phone : +49 341 48503-0
Fax   : +49 341 48503-99
E-mail: mailto:gunther.ebert@ixos-leipzig.de
www   : http://www.ixos-leipzig.de

-
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]