浏览代码

* handle ARM PIC jump tables in determining the maximum offset for
pc-relative loads

git-svn-id: trunk@27105 -

Jonas Maebe 11 年之前
父节点
当前提交
45e03d768e
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      compiler/arm/aasmcpu.pas

+ 3 - 2
compiler/arm/aasmcpu.pas

@@ -1037,9 +1037,10 @@ implementation
               begin
               begin
                 case taicpu(hp).opcode of
                 case taicpu(hp).opcode of
                   A_BX,
                   A_BX,
-                  A_LDR:
+                  A_LDR,
+                  A_ADD:
                     { approximation if we hit a case jump table }
                     { approximation if we hit a case jump table }
-                    if ((taicpu(hp).opcode=A_LDR) and not(GenerateThumbCode or GenerateThumb2Code) and
+                    if ((taicpu(hp).opcode in [A_ADD,A_LDR]) and not(GenerateThumbCode or GenerateThumb2Code) and
                        (taicpu(hp).oper[0]^.typ=top_reg) and
                        (taicpu(hp).oper[0]^.typ=top_reg) and
                       (taicpu(hp).oper[0]^.reg=NR_PC)) or
                       (taicpu(hp).oper[0]^.reg=NR_PC)) or
                       ((taicpu(hp).opcode=A_BX) and (GenerateThumbCode) and
                       ((taicpu(hp).opcode=A_BX) and (GenerateThumbCode) and