Final 1.10 patches.

committer: mfx <mfx> 977313794 +0000
This commit is contained in:
Markus F.X.J. Oberhumer
2000-12-20 12:03:14 +00:00
parent f6e5623eaa
commit a24af0ce74
12 changed files with 132 additions and 55 deletions
+19 -6
View File
@@ -48,6 +48,10 @@ override target = vc6
endif
# util var for use in the rules - basename of the current target
override T = $(basename $@)
# /***********************************************************************
# // object files
# ************************************************************************/
@@ -120,7 +124,7 @@ LDFLAGS = -g
else
LDFLAGS = -s
endif
LDFLAGS += -Wl,-Map,$(basename $@).map
LDFLAGS += -Wl,-Map,$T.map
LDLIBS =
LDLIBS = -lz
LIBDIRS =
@@ -230,7 +234,7 @@ CFLAGS = -W4 -WX
CXXFLAGS1 = $(CFLAGS) -GR -GX -EHa
CXXFLAGS2 = $(CFLAGS)
LDFLAGS =
LINK_LDFLAGS = /link /map:$(basename $@).map
LINK_LDFLAGS = /link /map:$T.map
ifneq ($(strip $(DOS_LIBDIRS)),)
LIB := $(DOS_LIBDIRS);$(LIB)
@@ -245,8 +249,7 @@ ifeq (1,2)
else
# link against msvcrt.dll
CC += -MD
##LDLIBS = $(u).lib zlib.lib setargv.obj
LDLIBS = $(u).lib setargv.obj
LDLIBS = $(DOS_LDLIBS) zlib.lib setargv.obj
endif
ifeq ($(DEBUG),1)
CFLAGS += -Od -ZI
@@ -306,8 +309,7 @@ CXXFLAGS1 = $(CFLAGS)
CXXFLAGS2 = $(CFLAGS)
CFLAGS_OUTPUT = -o$@
LDFLAGS =
##LDLIBS = $(u).lib zlib.lib
LDLIBS = $(u).lib
LDLIBS = $(DOS_LDLIBS) zlib.lib
ifneq ($(strip $(DOS_LIBDIRS)),)
LIB := $(DOS_LIBDIRS);$(LIB)
@@ -363,6 +365,17 @@ $(upx_exe): $(OBJECTS) $(LIBS)
$(LINK_EXE)
$(STUBEDIT_EXE)
ifeq ($(target),djgpp2)
cwsbind: $(upx_exe)
-rm -f $T.cof
$(upx_exe) -1 --coff -o $T.cof $(upx_exe)
cat $(DJDIR)/bin/cwsdstub.exe $T.cof > $(upx_exe)
$(upx_exe) -d $(upx_exe)
$(upx_exe) --best $(upx_exe)
endif
unupx:
$(MAKE) target=vc6 unupx.dll
+2
View File
@@ -26,10 +26,12 @@ DOS_LIBDIRS := $(DOS_LIBDIRS);$(UDIR)
endif
LDLIBS += -l$(u)
DOS_LDLIBS += $(u).lib
DEFS := $(DEFS)
INCLUDES := $(INCLUDES)
LIBDIRS := $(LIBDIRS)
LDLIBS := $(LDLIBS)
DOS_LDLIBS := $(DOS_LDLIBS)
+4 -7
View File
@@ -227,11 +227,6 @@ typedef RETSIGTYPE (SIGTYPEENTRY *sig_type)(int);
# define MODE_T int
#endif
#if !defined(HAVE_STRCHR)
# if defined(HAVE_INDEX)
# define strchr index
# endif
#endif
#if !defined(HAVE_STRCASECMP)
# if defined(HAVE_STRICMP)
# define strcasecmp stricmp
@@ -299,8 +294,10 @@ typedef RETSIGTYPE (SIGTYPEENTRY *sig_type)(int);
#endif
// avoid warnings about shadowing that obsolete index() function
#define index upx_index
// avoid warnings about shadowing global functions
#define basename upx_basename
#define index upx_index
#define outp upx_outp
// a dummy statement
#define nop ((void)0)
+31 -20
View File
@@ -127,9 +127,21 @@ void show_help(int x)
con_fprintf(f,"Overlay options:\n");
fg = con_fg(f,fg);
con_fprintf(f,
" --overlay=skip don't compress a file with an overlay\n"
" --overlay=copy copy any extra data attached to the file [default]\n"
" --overlay=strip strip any extra data attached to the file [dangerous]\n"
" --overlay=skip don't compress a file with an overlay\n"
"\n");
fg = con_fg(f,FG_YELLOW);
con_fprintf(f,"Options for djgpp2/coff:\n");
fg = con_fg(f,fg);
con_fprintf(f,
" --coff produce COFF output [default: EXE]\n"
"\n");
fg = con_fg(f,FG_YELLOW);
con_fprintf(f,"Options for dos/com:\n");
fg = con_fg(f,fg);
con_fprintf(f,
" --8086 make compressed com work on any 8086\n"
"\n");
fg = con_fg(f,FG_YELLOW);
con_fprintf(f,"Options for dos/exe:\n");
@@ -139,24 +151,12 @@ void show_help(int x)
" --no-reloc put no relocations in to the exe header\n"
"\n");
fg = con_fg(f,FG_YELLOW);
con_fprintf(f,"Options for dos/com:\n");
fg = con_fg(f,fg);
con_fprintf(f,
" --8086 make compressed com work on any 8086\n"
"\n");
fg = con_fg(f,FG_YELLOW);
con_fprintf(f,"Options for dos/sys:\n");
fg = con_fg(f,fg);
con_fprintf(f,
" --8086 make compressed sys work on any 8086\n"
"\n");
fg = con_fg(f,FG_YELLOW);
con_fprintf(f,"Options for djgpp2/coff:\n");
fg = con_fg(f,fg);
con_fprintf(f,
" --coff produce COFF output [default: EXE]\n"
"\n");
fg = con_fg(f,FG_YELLOW);
con_fprintf(f,"Options for watcom/le:\n");
fg = con_fg(f,fg);
con_fprintf(f,
@@ -177,7 +177,7 @@ void show_help(int x)
"\n");
#if 0
fg = con_fg(f,FG_YELLOW);
con_fprintf(f,"Options for linux/i386\n");
con_fprintf(f,"Options for linux/386\n");
fg = con_fg(f,fg);
con_fprintf(f,
" --script use /usr/local/lib/upx/upx[bd] as decompressor\n"
@@ -189,12 +189,23 @@ void show_help(int x)
con_fprintf(f,
" file.. executables to (de)compress\n"
"\n"
"This version supports: dos/exe, dos/com, dos/sys, djgpp2/coff, watcom/le,\n"
" win32/pe, rtm32/pe, tmt/adam, atari/tos\n"
" linux/elf386, linux/sh386, linux/386\n"
"%s",
"\nUPX comes with ABSOLUTELY NO WARRANTY; for details visit http://upx.tsx.org\n"
//"\nUPX comes with ABSOLUTELY NO WARRANTY; for details type `upx -L'.\n"
"This version supports:\n "
"atari/tos, "
"bvmlinuz/386, "
"djgpp2/coff, "
"dos/com, "
"dos/exe, "
"dos/sys,\n "
"linux/386, "
"linux/elf386, "
"linux/sh386, "
"rtm32/pe, "
"tmt/adam, "
"vmlinuz/386,\n "
"watcom/le, "
"win32/pe"
"\n\nUPX comes with ABSOLUTELY NO WARRANTY; for details visit http://upx.tsx.org\n"
//"\n\nUPX comes with ABSOLUTELY NO WARRANTY; for details type `upx -L'.\n"
"");
+8
View File
@@ -1136,6 +1136,14 @@ int main(int argc, char *argv[])
fg = con_fg(f,fg);
}
#endif
#if 1 && !defined(WITH_NRV)
{
FILE *f = stdout;
int fg = con_fg(f,FG_GREEN);
con_fprintf(f,"\nINFO: this version does not use the NRV library - compression ratio is worse\n");
fg = con_fg(f,fg);
}
#endif
#if 0 && defined(__GLIBC__)
//malloc_stats();
+1 -1
View File
@@ -130,7 +130,7 @@ void PackLinuxI386elf::patchLoader()
upx_compress_config_t conf; memset(&conf, 0xff, sizeof(conf));
conf.c_flags = 0;
upx_uint result_buffer[16];
size_t cprLsize;
upx_uint cprLsize;
upx_compress(
loader + fold_begin, lsize - fold_begin,
cprLoader, &cprLsize,
+1 -1
View File
@@ -110,7 +110,7 @@ void PackLinuxI386sh::patchLoader()
upx_compress_config_t conf; memset(&conf, 0xff, sizeof(conf));
conf.c_flags = 0;
upx_uint result_buffer[16];
size_t cprLsize;
upx_uint cprLsize;
upx_compress(
loader + fold_begin, lsize - fold_begin,
cprLoader, &cprLsize,
+2 -2
View File
@@ -447,8 +447,8 @@ void PackLinuxI386::patchLoader()
upx_compress_config_t conf; memset(&conf, 0xff, sizeof(conf));
conf.c_flags = 0;
upx_uint result_buffer[16];
size_t const uncLsize = lsize - fold_begin;
size_t cprLsize;
upx_uint const uncLsize = lsize - fold_begin;
upx_uint cprLsize;
upx_compress(
loader + fold_begin, uncLsize,
cprLoader, &cprLsize,