From d14bd49f46574c96d84c379205f105f1b1ac9a1f Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Mon, 4 Sep 2006 14:23:21 +0200 Subject: [PATCH 1/2] Updated mips Makefile. --- .../src/arch/mips/mipsel.r3000/Makefile.extra | 44 ++++++++++++++++--- 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/src/stub/src/arch/mips/mipsel.r3000/Makefile.extra b/src/stub/src/arch/mips/mipsel.r3000/Makefile.extra index 2202cc57..a1a92c1e 100644 --- a/src/stub/src/arch/mips/mipsel.r3000/Makefile.extra +++ b/src/stub/src/arch/mips/mipsel.r3000/Makefile.extra @@ -34,18 +34,32 @@ c := tc.method-lzma.gcc $c = $(tc.mipsel.r3000-ps1.gcc) $c += -pie -fPIC $c += -Os -fomit-frame-pointer +$c += -fno-unit-at-a-time +$c += -ffunction-sections +$c += -fwrapv +# Important note: these settings are tuned for size so that the +# resulting code can get compressed efficiently with NRV2B. +# Also see test-stub-compression below. +ifneq ($(findstring -gcc-3.4.4,$(firstword $($c))),) +$c += -mtune=r3000 +$c += -fno-schedule-insns +$c += -fno-schedule-insns2 +else ifneq ($(findstring -gcc-4.1.1,$(firstword $($c))),) $c += -mtune=r4000 -ifeq (1,1) -# Important note: these settings are tuned so that the resulting -# code can get compressed efficiently with NRV2B. $c += -fno-regmove $c += -fno-sched-spec $c += -fno-schedule-insns $c += -fno-schedule-insns2 +else ifneq ($(findstring -gcc-4.2.0,$(firstword $($c))),) +# gcc-4.2.0-20060826 +$c += -fno-wrapv +$c += -mtune=r4000 +$c += -fno-sched-spec +$c += -fno-schedule-insns +$c += -ffixed-30 +else +$(error unknown gcc version: $(firstword $($c))) endif -$c += -fno-unit-at-a-time -$c += -ffunction-sections -$c += -fwrapv $c += -I$(UPX_LZMADIR) $c += -I$(top_srcdir)/src @@ -59,3 +73,21 @@ lzma_d_c%.S : lzma_d_c.c lzma_d_cf.% : PP_FLAGS = -DFAST lzma_d_cs.% : PP_FLAGS = -DSMALL + + +# /*********************************************************************** +# // test-stub-compression +# ************************************************************************/ + +test-stub-compression: tc_list = mipsel.r3000-ps1 default +test-stub-compression: lzma_d_cf.S lzma_d_cs.S + @md5sum tmp/lzma_d_cs.bin + $(call tc,readelf) -S tmp/lzma_d_cs.o | egrep 'LzmaDecode ' + @rm -f tmp/lzma_d_cs.bin.c.* + @bzip2 -c -9 < tmp/lzma_d_cs.bin > tmp/lzma_d_cs.bin.c.bz2 + @gzip -c -9mn < tmp/lzma_d_cs.bin > tmp/lzma_d_cs.bin.c.gz +ifdef UPX_UCLPACK + @$(UPX_UCLPACK) --nrv2b --10 tmp/lzma_d_cs.bin tmp/lzma_d_cs.bin.c.uclpack-nrv2b | egrep ' into ' +endif + @ls -l tmp/lzma_d_cs.bin.c.* +.PHONY: test-stub-compression From 80218c1eca90bd3bc5827618de857c971b57afba Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Wed, 6 Sep 2006 14:31:30 +0200 Subject: [PATCH 2/2] Atari/tos is currently broken, so throw an InternalError. --- src/p_tos.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/p_tos.cpp b/src/p_tos.cpp index 9aee73c6..2859a79a 100644 --- a/src/p_tos.cpp +++ b/src/p_tos.cpp @@ -409,6 +409,7 @@ void PackTos::fileInfo() void PackTos::pack(OutputFile *fo) { + throwInternalError("atari/tos is currenty broken; this will get fixed in UPX 2.91"); unsigned t; unsigned nrelocs = 0; unsigned relocsize = 0;