From a55b3480ef56b21a68b62aab5212f53d10b820b7 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Tue, 21 Oct 2003 10:38:16 +0000 Subject: [PATCH] Small updates. committer: mfx 1066732696 +0000 --- NEWS | 1 + doc/upx.pod | 34 ++++++++++++++++++++-------------- src/Makefile | 23 +++++++++++++---------- src/Makefile.bld | 48 ++++++++++++++++++++++++++---------------------- src/file.h | 2 +- src/main.cpp | 1 + 6 files changed, 62 insertions(+), 47 deletions(-) diff --git a/NEWS b/NEWS index b5933915..e813e6e1 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,7 @@ Changes in 1.91 beta (XX Sep 2003): * UNSTABLE BETA VERSION - DO NOT USE EXCEPT FOR TESTING * djgpp2/coff: added support for recent binutils versions * watcom/le: don't crash on files without relocations + * Option `--brute' now implies `--crp-ms=999999'. Changes in 1.90 beta (11 Nov 2002): * UNSTABLE BETA VERSION - DO NOT USE EXCEPT FOR TESTING diff --git a/doc/upx.pod b/doc/upx.pod index 1589a92a..91eff922 100644 --- a/doc/upx.pod +++ b/doc/upx.pod @@ -20,7 +20,8 @@ B S<[ I ]> S<[ I ]> I... B is a portable, extendable, high-performance executable packer for several different executable formats. It achieves an excellent compression ratio and offers I<*very*> fast decompression. Your executables suffer -no memory overhead or other drawbacks for most of the formats supported. +no memory overhead or other drawbacks for most of the formats supported, +because of in-place decompression. While you may use B freely for both non-commercial and commercial executables (for details see the file LICENSE), we would highly @@ -36,11 +37,6 @@ is considered not politically correct ;-) ] B comes with ABSOLUTELY NO WARRANTY; for details see the file LICENSE. -Having said that, we think that B is quite stable now. Indeed we -have compressed lots of files without any problems. Also, the -current version has undergone several months of beta testing - -actually it's more than 4 years since our first public beta back in 1998. - This is the first production quality release, and we plan that future 1.xx releases will be backward compatible with this version. @@ -55,7 +51,8 @@ B is a versatile executable packer with the following features: - excellent compression ratio: compresses better than zip/gzip, use UPX to decrease the size of your distribution ! - - very fast decompression: about 10 MB/sec even on my old Pentium 133 + - very fast decompression: about 10 MB/sec on an ancient Pentium 133, + about 200 MB/sec on an Athlon XP 2000+. - no memory overhead for your compressed executables for most of the supported formats @@ -174,7 +171,7 @@ Quick start for achieving the best compression ratio: =over 4 -Try B. +Try B. =back @@ -190,9 +187,6 @@ Use the compression level B<--best>. Try one or both of the options B<--all-methods> and B<--all-filters>. -Info: the option B<--brute> is an abbrevation for all the options -B S<--all-methods> S<--all-filters>>. - =item * Try the option B<--crp-ms=NUMBER>. This uses more memory during compression @@ -203,6 +197,11 @@ The default value is 10000 (ten thousand). =item * +Info: the option B<--brute> is an abbrevation for the options +B S<--all-methods> S<--all-filters> S<--crp-ms=999999>>. + +=item * + Try if B<--overlay=strip> works. =item * @@ -215,9 +214,15 @@ For win32/pe programs there's B<--strip-relocs=0>. See notes below. =head1 OVERLAY HANDLING OPTIONS +Info: An "overlay" means auxillary data atached after the logical end of +an executable, and it often contains application specific data +(this is a common practice to avoid an extra data file, though +it would be better to use resource sections). + B handles overlays like many other executable packers do: it simply copies the overlay after the compressed image. This works with some -files, but doesn't work with others. +files, but doesn't work with others, depending on how an application +actually accesses this overlayed data. Since version 0.90 UPX defaults to B<--overlay=copy> for all executable formats. @@ -249,7 +254,8 @@ environment variable because of a COMMAND.COM limitation. Not all of the options are valid in the environment variable - B will tell you. -You can use the B<--no-env> option to turn this support off. +You can explicitly use the B<--no-env> option to ignore the +environment variable. @@ -859,7 +865,7 @@ Extra options available for this executable format: address greater or equal to 0x400000. Usually the compressed files becomes smaller, but some files may become larger. Note that the resulting file will - not work under Win32s. + not work under Windows 3.x (Win32s). UPX never strips relocations from a DLL regardless of this option. diff --git a/src/Makefile b/src/Makefile index 7445ea0e..53a52056 100644 --- a/src/Makefile +++ b/src/Makefile @@ -3,20 +3,23 @@ # # usage: # `make target=linux' # linux -# `make target=djggp2' # dos32 - djggp2 -# `make target=cygwin' # win32 - cygwin 1.3.x -# `make target=mingw32' # win32 - mingw32 -# `make target=no-cygwin' # win32 - mingw32 as included in cygwin -# `make target=rsxnt' # win32 - rsxnt -# `make target=bc' # win32 - Borland C++ -# `make target=dm' # win32 - Digital Mars C++ -# `make target=ic' # win32 - Intel C++ -# `make target=vc' # win32 - Visual C++ -# `make target=wc' # win32 - Watcom C++ +# `make target=dos32-djggp2' # dos32 - djggp2 +# `make target=win32-cygwin' # win32 - cygwin +# `make target=win32-mingw32' # win32 - mingw32 +# `make target=win32-no-cygwin' # win32 - mingw32 as included in cygwin +# `make target=win32-rsxnt' # win32 - rsxnt +# `make target=win32-bc' # win32 - Borland C++ +# `make target=win32-dm' # win32 - Digital Mars C++ +# `make target=win32-ic' # win32 - Intel C++ +# `make target=win32-vc' # win32 - Visual C++ +# `make target=win32-wc' # win32 - Watcom C++ +# `make target=cross-amd64-linux' # x86_64-linux cross compiler # `make target=cross-mingw32' # i586-mingw32msvc cross compiler # `make target=cross-mint' # m68k-atari-mint cross compiler # `make target=gcc' # generic gcc # +# you can also set the `UPX_MAKE_TARGET' environment variable. +# # configuration section diff --git a/src/Makefile.bld b/src/Makefile.bld index 86829aa0..0288e3fc 100644 --- a/src/Makefile.bld +++ b/src/Makefile.bld @@ -1,5 +1,5 @@ # /*********************************************************************** -# // setup +# // perpare setup # ************************************************************************/ SHELL = /bin/sh @@ -217,7 +217,7 @@ ifeq ($(target),cross-amd64-linux) include $(srcdir)/Makedefs.gcc CC = x86_64-linux-gcc CXX = x86_64-linux-g++ -##LDLIBS += -lmcheck +LDLIBS += -lmcheck endif # cross-amd64-linux ifeq ($(target),cross-m68k-linux) @@ -270,7 +270,7 @@ endif ### dos32 - djgpp2 / emx ### -ifeq ($(target),djgpp2) +ifeq ($(target),dos32-djgpp2) include $(srcdir)/Makedefs.gcc e = .exe CXX = gxx @@ -284,7 +284,7 @@ endif endif endif -ifeq ($(target),emx) +ifeq ($(target),dos32-emx) include $(srcdir)/Makedefs.gcc e = .exe CXX = gcc @@ -298,24 +298,27 @@ endif ### win32 - cygwin / mingw32 / rsxnt ### -ifeq ($(target),cygwin) +ifeq ($(target),win32-cygwin) include $(srcdir)/Makedefs.gcc ##CXX = g++-2 e = .exe CCARCH += -mcygwin -march=i386 -mcpu=i686 +LDLIBS += -lwinmm endif -ifeq ($(target),mingw32) +ifeq ($(target),win32-mingw32) include $(srcdir)/Makedefs.gcc e = .exe CCARCH += -mno-cygwin -march=i386 -mcpu=i686 +LDLIBS += -lwinmm endif # mingw32 as included in cygwin -ifeq ($(target),no-cygwin) +ifeq ($(target),win32-no-cygwin) include $(srcdir)/Makedefs.gcc e = .exe CCARCH += -mno-cygwin -march=i386 -mcpu=i686 +LDLIBS += -lwinmm endif # mingw32 cross compiler @@ -325,10 +328,11 @@ e = .exe CC = i586-mingw32msvc-gcc CXX = i586-mingw32msvc-g++ CCARCH += -march=i386 -mcpu=i686 +LDLIBS += -lwinmm endif # rsxnt (g++ 2.8.1) -ifeq ($(target),rsxnt) +ifeq ($(target),win32-rsxnt) include $(srcdir)/Makedefs.gcc e = .exe CXX = gcc @@ -343,7 +347,7 @@ endif ### win32 - Borland C++ ### -ifeq ($(target),bc) +ifeq ($(target),win32-bc) o = .obj a = .lib e = .exe @@ -374,14 +378,14 @@ else CFLAGS += -O2 -d endif -endif # bc +endif # win32-bc ### ### win32 - Digital Mars C++ ### -ifeq ($(target),dm) +ifeq ($(target),win32-dm) o = .obj a = .lib e = .exe @@ -404,14 +408,14 @@ else CFLAGS += -o endif -endif # dm +endif # win32-dm ### ### win32 - Intel C++ ### -ifeq ($(target),ic) +ifeq ($(target),win32-ic) o = .obj a = .lib e = .exe @@ -446,14 +450,14 @@ else endif RESOURCES := $(subst .rc,.res,$(notdir $(wildcard $(srcdir)/*.rc))) -endif # ic +endif # win32-ic ### ### win32 - Symantec C++ ### -ifeq ($(target),sc) +ifeq ($(target),win32-sc) o = .obj a = .lib e = .exe @@ -476,14 +480,14 @@ else CFLAGS += -o endif -endif # dm +endif # win32-sc ### ### win32 - Visual C++ ### -ifeq ($(target),vc) +ifeq ($(target),win32-vc) o = .obj a = .lib e = .exe @@ -519,14 +523,14 @@ else endif RESOURCES := $(subst .rc,.res,$(notdir $(wildcard $(srcdir)/*.rc))) -endif # vc +endif # win32-vc ### ### win32 - Watcom C++ ### -ifeq ($(target),wc) +ifeq ($(target),win32-wc) o = .obj a = .lib e = .exe @@ -560,11 +564,11 @@ else CFLAGS += -olr endif -endif # wc +endif # win32-wc ### -### win64 - Intel C++ +### win64 - Intel C++ [IA64] ### ifeq ($(target),win64-ic) @@ -606,7 +610,7 @@ endif # win64-ic ### -### win64 - Visual C++ +### win64 - Visual C++ [AMD64 & IA64] ### ifeq ($(target),win64-vc) diff --git a/src/file.h b/src/file.h index 4c7d927c..b9b0740a 100644 --- a/src/file.h +++ b/src/file.h @@ -158,7 +158,7 @@ protected: // **************************************************************************/ -#if 0 +#if 0 /* NOT USED */ class MemoryOutputFile : public FileBase { typedef FileBase super; diff --git a/src/main.cpp b/src/main.cpp index 14be0b44..ee822023 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -530,6 +530,7 @@ static int do_option(int optc, const char *arg) opt->method = -1; opt->all_filters = true; opt->filter = -1; + opt->crp.m_size = 999999; /* fallthrough */ case 900: // --best if (!set_method(-1, 10))