浏览代码

* Support Intel [ebx].offset var PIC construct

git-svn-id: trunk@16109 -
pierre 15 年之前
父节点
当前提交
207e0b58f5
共有 1 个文件被更改,包括 9 次插入1 次删除
  1. 9 1
      compiler/x86/rax86int.pas

+ 9 - 1
compiler/x86/rax86int.pas

@@ -1626,7 +1626,15 @@ Unit Rax86int;
               begin
               begin
                 case oper.opr.typ of
                 case oper.opr.typ of
                   OPR_REFERENCE :
                   OPR_REFERENCE :
-                    inc(oper.opr.ref.offset,BuildRefConstExpression);
+                    if (actasmtoken=AS_OFFSET) and
+                       (cs_create_pic in current_settings.moduleswitches) then
+                      begin
+                        Consume(AS_OFFSET); 
+                        oper.opr.ref.refaddr:=addr_pic;
+                        BuildOperand(oper,false);
+                      end
+                    else
+                      inc(oper.opr.ref.offset,BuildRefConstExpression);
                   OPR_LOCAL :
                   OPR_LOCAL :
                     inc(oper.opr.localsymofs,BuildConstExpression);
                     inc(oper.opr.localsymofs,BuildConstExpression);
                   OPR_NONE,
                   OPR_NONE,