Ver Fonte

+ import DGROUP omf fixup references

git-svn-id: trunk@31390 -
nickysn há 10 anos atrás
pai
commit
e88dc71983
1 ficheiros alterados com 40 adições e 0 exclusões
  1. 40 0
      compiler/ogomf.pas

+ 40 - 0
compiler/ogomf.pas

@@ -1489,6 +1489,7 @@ implementation
         sym: TObjSymbol;
         RelocType: TObjRelocationType;
         target_section: TOmfObjSection;
+        target_group: TOmfObjSectionGroup;
       begin
         Result:=False;
 
@@ -1647,6 +1648,45 @@ implementation
                 exit;
               end;
           end
+        else if Fixup.TargetMethod in [ftmGroupIndex,ftmGroupIndexNoDisp] then
+          begin
+            target_group:=TOmfObjSectionGroup(objdata.GroupsList[Fixup.TargetDatum-1]);
+            if target_group.Name<>'DGROUP' then
+              begin
+                InputError('Fixup target group other than "DGROUP" is not supported');
+                exit;
+              end;
+            case Fixup.LocationType of
+              fltBase:
+                case Fixup.Mode of
+                  fmSegmentRelative:
+                    RelocType:=RELOC_DGROUP;
+                  fmSelfRelative:
+                    RelocType:=RELOC_DGROUPREL;
+                end;
+              else
+                begin
+                  InputError('Unsupported fixup location type '+IntToStr(Ord(Fixup.LocationType))+' in reference to group '+target_group.Name);
+                  exit;
+                end;
+            end;
+            reloc:=TOmfRelocation.CreateSection(Fixup.LocationOffset,nil,RelocType);
+            objsec.ObjRelocations.Add(reloc);
+            case Fixup.FrameMethod of
+              ffmTarget:
+                {nothing};
+              else
+                begin
+                  InputError('Unsupported frame method '+IntToStr(Ord(Fixup.FrameMethod))+' in reference to group '+target_group.Name);
+                  exit;
+                end;
+            end;
+            if Fixup.TargetDisplacement<>0 then
+              begin
+                InputError('Unsupported nonzero target displacement '+IntToStr(Fixup.TargetDisplacement)+' in reference to group '+target_group.Name);
+                exit;
+              end;
+          end
         else
           begin
             {todo: convert other fixup types as well }