diff --git a/src/stub/src/amd64-win64.pep.S b/src/stub/src/amd64-win64.pep.S index a94808b7..46aad2e7 100644 --- a/src/stub/src/amd64-win64.pep.S +++ b/src/stub/src/amd64-win64.pep.S @@ -205,6 +205,7 @@ section LZMA_HEAD mov esi, IMM32(lzma_c_len) .att_syntax +#define NO_RED_ZONE #include "arch/amd64/regs.h" #include "arch/amd64/lzma_d.S" diff --git a/src/stub/src/arch/amd64/Makefile.extra b/src/stub/src/arch/amd64/Makefile.extra index d8ee149a..9eba1b0a 100644 --- a/src/stub/src/arch/amd64/Makefile.extra +++ b/src/stub/src/arch/amd64/Makefile.extra @@ -14,7 +14,7 @@ vpath %.c $(top_srcdir)/src/stub/src/c STUBS = include $(top_srcdir)/src/stub/src/c/Makevars.lzma ifneq ($(UPX_LZMA_VERSION),) -STUBS += lzma_d_cf.S lzma_d_cs.S +STUBS += lzma_d_cf.S lzma_d_cs.S lzma_d_cn.S endif default.targets = all @@ -52,3 +52,4 @@ lzma_d_c%.S : lzma_d_c.c lzma_d_cf.% : PP_FLAGS = -DFAST lzma_d_cs.% : PP_FLAGS = -DSMALL +lzma_d_cn.% : PP_FLAGS = -DFAST -mno-red-zone diff --git a/src/stub/src/arch/amd64/lzma_d.S b/src/stub/src/arch/amd64/lzma_d.S index 1f297e4d..bed56d1f 100644 --- a/src/stub/src/arch/amd64/lzma_d.S +++ b/src/stub/src/arch/amd64/lzma_d.S @@ -92,12 +92,21 @@ section LZMA_ELF00 pushq %rax // return address slot (dummy CALL) +#ifndef NO_RED_ZONE + section LZMA_DEC10 #include "lzma_d_cs.S" section LZMA_DEC20 #include "lzma_d_cf.S" +#else + +section LZMA_DEC20 +#include "lzma_d_cn.S" + +#endif + section LZMA_DEC30 movq -1*8(%rbp),%rsi // src [after header] movq 2*8(%rbp),%rdi // dst