PE: Use no red zone on AMD64

This commit is contained in:
Kornel Pal 2021-12-16 06:59:26 +01:00 committed by Markus F.X.J. Oberhumer
parent f3e710394a
commit 966b571b7c
3 changed files with 12 additions and 1 deletions

View File

@ -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"

View File

@ -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

View File

@ -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