浏览代码

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

Jonas Maebe 10 年之前
父节点
当前提交
399ffb2005
共有 1 个文件被更改,包括 7 次插入4 次删除
  1. 7 4
      compiler/powerpc64/cpupi.pas

+ 7 - 4
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;