浏览代码

+ handle RELOC_FARPTR48 relocations as well in TOmfObjData.writeReloc; this is
not used yet, but is added for completeness (and might be useful, if we add an
i386 target, that uses the OMF object format)

git-svn-id: trunk@32935 -

nickysn 9 年之前
父节点
当前提交
4f8baf29c6
共有 1 个文件被更改,包括 11 次插入2 次删除
  1. 11 2
      compiler/ogomf.pas

+ 11 - 2
compiler/ogomf.pas

@@ -569,12 +569,21 @@ implementation
         objreloc: TOmfRelocation;
         symaddr: AWord;
       begin
-        { RELOC_FARPTR = RELOC_ABSOLUTE+RELOC_SEG }
+        { RELOC_FARPTR = RELOC_ABSOLUTE16+RELOC_SEG }
         if Reloctype=RELOC_FARPTR then
           begin
             if len<>4 then
               internalerror(2015041502);
-            writeReloc(Data,2,p,RELOC_ABSOLUTE);
+            writeReloc(Data,2,p,RELOC_ABSOLUTE16);
+            writeReloc(0,2,p,RELOC_SEG);
+            exit;
+          end
+        { RELOC_FARPTR48 = RELOC_ABSOLUTE16+RELOC_SEG }
+        else if Reloctype=RELOC_FARPTR48 then
+          begin
+            if len<>6 then
+              internalerror(2015041502);
+            writeReloc(Data,4,p,RELOC_ABSOLUTE32);
             writeReloc(0,2,p,RELOC_SEG);
             exit;
           end;