* 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 -
This commit is contained in:
Jonas Maebe 2015-03-14 18:36:14 +00:00
parent e3f451066b
commit 399ffb2005

View File

@ -74,17 +74,19 @@ var
lasize, lasize,
minstacksize: aword; minstacksize: aword;
begin begin
if target_info.abi<>abi_powerpc_elfv2 then
lasize:=LinkageAreaSizeELF
else
lasize:=LinkageAreaSizeELFv2;
if not (po_assembler in procdef.procoptions) then begin if not (po_assembler in procdef.procoptions) then begin
{ align the stack properly } { align the stack properly }
if target_info.abi<>abi_powerpc_elfv2 then if target_info.abi<>abi_powerpc_elfv2 then
begin begin
{ same for AIX/Darwin } { same for AIX/Darwin }
lasize:=LinkageAreaSizeELF;
minstacksize:=MINIMUM_STACKFRAME_SIZE; minstacksize:=MINIMUM_STACKFRAME_SIZE;
end end
else else
begin begin
lasize:=LinkageAreaSizeELFv2;
minstacksize:=MINIMUM_STACKFRAME_SIZE_ELFV2; minstacksize:=MINIMUM_STACKFRAME_SIZE_ELFV2;
end; end;
ofs := align(maxpushedparasize + lasize, ELF_STACK_ALIGN); ofs := align(maxpushedparasize + lasize, ELF_STACK_ALIGN);
@ -99,8 +101,9 @@ begin
end else begin end else begin
if (current_procinfo.procdef.localst.symtabletype=localsymtable) and if (current_procinfo.procdef.localst.symtabletype=localsymtable) and
(tabstractlocalsymtable(current_procinfo.procdef.localst).count_locals <> 0) then (tabstractlocalsymtable(current_procinfo.procdef.localst).count_locals <> 0) then
{ at 0(r1), the previous value of r1 will be stored } { at 0(r1), the previous value of r1 will be stored; also make sure
tg.setfirsttemp(8); there's room to store lr etc by potential callees}
tg.setfirsttemp(lasize);
end; end;
end; end;