From 399ffb2005020f86ed58d7d0e96043b2ac4de26e Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sat, 14 Mar 2015 18:36:14 +0000 Subject: [PATCH] * allocate enough room in assembler routines for a complete linkage area so that potential callees have enough room to store their LR etc if needed git-svn-id: trunk@30212 - --- compiler/powerpc64/cpupi.pas | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/compiler/powerpc64/cpupi.pas b/compiler/powerpc64/cpupi.pas index 7802b0bc4f..ac87aa7de3 100644 --- a/compiler/powerpc64/cpupi.pas +++ b/compiler/powerpc64/cpupi.pas @@ -74,17 +74,19 @@ var lasize, minstacksize: aword; begin + if target_info.abi<>abi_powerpc_elfv2 then + lasize:=LinkageAreaSizeELF + else + lasize:=LinkageAreaSizeELFv2; if not (po_assembler in procdef.procoptions) then begin { align the stack properly } if target_info.abi<>abi_powerpc_elfv2 then begin { same for AIX/Darwin } - lasize:=LinkageAreaSizeELF; minstacksize:=MINIMUM_STACKFRAME_SIZE; end else begin - lasize:=LinkageAreaSizeELFv2; minstacksize:=MINIMUM_STACKFRAME_SIZE_ELFV2; end; ofs := align(maxpushedparasize + lasize, ELF_STACK_ALIGN); @@ -99,8 +101,9 @@ begin end else begin if (current_procinfo.procdef.localst.symtabletype=localsymtable) and (tabstractlocalsymtable(current_procinfo.procdef.localst).count_locals <> 0) then - { at 0(r1), the previous value of r1 will be stored } - tg.setfirsttemp(8); + { at 0(r1), the previous value of r1 will be stored; also make sure + there's room to store lr etc by potential callees} + tg.setfirsttemp(lasize); end; end;