浏览代码

* copy the darwin got register to a new register when using it, so it
cannot get modified

git-svn-id: trunk@22240 -

Jonas Maebe 13 年之前
父节点
当前提交
35c70a6c96
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      compiler/x86/cgx86.pas

+ 3 - 1
compiler/x86/cgx86.pas

@@ -508,7 +508,9 @@ unit cgx86;
                else
                else
                  begin
                  begin
                    include(current_procinfo.flags,pi_needs_got);
                    include(current_procinfo.flags,pi_needs_got);
-                   hreg:=current_procinfo.got;
+                   { make a copy of the got register, hreg can get modified }
+                   hreg:=cg.getaddressregister(list);
+                   a_load_reg_reg(list,OS_ADDR,OS_ADDR,current_procinfo.got,hreg);
                    ref.relsymbol:=current_procinfo.CurrGOTLabel;
                    ref.relsymbol:=current_procinfo.CurrGOTLabel;
                  end;
                  end;
                add_hreg:=true
                add_hreg:=true