瀏覽代碼

* only set OT_SHORT if the source and target are in the same objsection

git-svn-id: trunk@2905 -
peter 19 年之前
父節點
當前提交
94d9a89774
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5 3
      compiler/x86/aasmcpu.pas

+ 5 - 3
compiler/x86/aasmcpu.pas

@@ -1046,9 +1046,11 @@ implementation
                             inc(l,InsOffset-LastInsOffset);
                             inc(l,InsOffset-LastInsOffset);
                           { instruction size will then always become 2 (PFV) }
                           { instruction size will then always become 2 (PFV) }
                           relsize:=(InsOffset+2)-l;
                           relsize:=(InsOffset+2)-l;
-                          if (not assigned(currsym) or
-                              ((currsym.bind<>AB_EXTERNAL) and (currsym.address<>0))) and
-                             (relsize>=-128) and (relsize<=127) then
+                          if (relsize>=-128) and (relsize<=127) and
+                             (
+                              not assigned(currsym) or
+                              (currsym.objsection=objdata.currobjsec)
+                             ) then
                             ot:=OT_IMM32 or OT_SHORT
                             ot:=OT_IMM32 or OT_SHORT
                           else
                           else
                             ot:=OT_IMM32 or OT_NEAR;
                             ot:=OT_IMM32 or OT_NEAR;