www.digitalmars.com         C & C++   DMDScript  

D - UPX fails with D programs

reply kinghajj <kinghajj_member pathlink.com> writes:
Apparently, UPX cannot successfully compress D programs. If you try, the
compressed program does nothing. Can this be fixed?
Dec 12 2003
parent reply Ilya Minkov <minkov cs.tum.edu> writes:
kinghajj wrote:
 Apparently, UPX cannot successfully compress D programs. If you try, the
 compressed program does nothing. Can this be fixed?

No, it cannot. The linker produces executables which UPX doesn't like for some reason. The stable one produces broken executables, the current beta complains, but produces valid exes. It is probably some "feature" of the PEs output by the linker. However, it cannot be changed since the linker was coded in raw assembly for speed, and Walter doesn't like the idea of changing it. It is definately not a real bug in linker, since most other compressors have no problem with it. I have informed the UPX guys of the problem, but got no reply. But with one of them starting to use DMC now, he will eventually notice and/or fix it. There are 3 solutions: - (complains) Use current Beta UPX. - (works well) Use Petite compressor from Ian Luck. - (not testet) Use an alternative Linker from Christof Meerwald: http://cmeerw.org/prog/owtools/ -eye
Dec 13 2003
parent reply "Walter" <walter digitalmars.com> writes:
"Ilya Minkov" <minkov cs.tum.edu> wrote in message
news:brfb62$1k1u$1 digitaldaemon.com...
 It is probably some "feature" of the PEs output by the linker.

The DM linker puts out standard PE files as defined by Microsoft. Those PE files have worked fine with every version of Win32 from Win32s to WinXP, every PE debugger tried, and every PE file tool used on it. Except UPX. This problem is a bug in UPX.
Dec 13 2003
parent reply Maik Zumstrull <Maik.Zumstrull gmx.de> writes:
Walter wrote:

It is probably some "feature" of the PEs output by the linker.


 The DM linker puts out standard PE files as defined by Microsoft. Those PE
 files have worked fine with every version of Win32 from Win32s to WinXP,
 every PE debugger tried, and every PE file tool used on it. Except UPX. This
 problem is a bug in UPX.

It would still be interesting to know what it is about DM executables that is different (which does not have to mean in violation of the standard) from executables UPX has no problem with. I'm not saying that DM should be changed so that UPX can stay the way it is; I'm just saying the problem should be completely analysed before throwing blame either way.
Dec 14 2003
parent "Walter" <walter digitalmars.com> writes:
"Maik Zumstrull" <Maik.Zumstrull gmx.de> wrote in message
news:bri3rm$2hoa$1 digitaldaemon.com...
 Walter wrote:
It is probably some "feature" of the PEs output by the linker.



 files have worked fine with every version of Win32 from Win32s to WinXP,
 every PE debugger tried, and every PE file tool used on it. Except UPX.


 problem is a bug in UPX.

that is different (which does not have to mean in violation of the standard) from executables UPX has no problem with. I'm not saying that DM should be changed so that UPX can stay the way it is; I'm just saying the problem should be completely analysed before throwing blame either

This would be easy to find by someone with access to the UPX source who was willing to spend some time tracing through it. But realisitically, UPX should work with all PE files that the win32 loader accepts, or give a reasonable diagnostic otherwise.
Dec 14 2003