Jelajahi Sumber

* group T and R records together and call a function (not implemented yet) to handle them in pairs

git-svn-id: trunk@45561 -
nickysn 5 tahun lalu
induk
melakukan
ad66f17a87
1 mengubah file dengan 22 tambahan dan 2 penghapusan
  1. 22 2
      compiler/ogrel.pas

+ 22 - 2
compiler/ogrel.pas

@@ -657,6 +657,13 @@ implementation
       end;
 
     function TRelObjInput.ReadObjData(AReader: TObjectreader; out Data: TObjData): boolean;
+
+      function HandleTR(const T,R: string): boolean;
+        begin
+          { todo: implement }
+          result:=true;
+        end;
+
       const
         GenericRelErrMsg='Error reading REL file';
       var
@@ -668,6 +675,7 @@ implementation
         tmpint: SizeInt;
         CurrSec: TObjSection=nil;
         objsym: TObjSymbol;
+        LastT: string='';
       begin
         FReader:=AReader;
         InputFileName:=AReader.FileName;
@@ -891,11 +899,23 @@ implementation
                     end;
                   'T': { T line () }
                     begin
-                      { todo: implement }
+                      if LastT<>'' then
+                        begin
+                          InputError('T record not followed by R record');
+                          exit;
+                        end;
+                      LastT:=s;
                     end;
                   'R': { R line (relocation information) }
                     begin
-                      { todo: implement }
+                      if LastT='' then
+                        begin
+                          InputError('R record without T record');
+                          exit;
+                        end;
+                      if not HandleTR(LastT,s) then
+                        exit;
+                      LastT:='';
                     end;
                   'P': { P line (paging information) }
                     begin