Browse Source

+ order omf sections first by classname, then by name

git-svn-id: trunk@31352 -
nickysn 10 years ago
parent
commit
1b9eeee25d
1 changed files with 16 additions and 0 deletions
  1. 16 0
      compiler/ogomf.pas

+ 16 - 0
compiler/ogomf.pas

@@ -207,6 +207,7 @@ interface
       TMZExeOutput = class(TExeOutput)
       TMZExeOutput = class(TExeOutput)
       protected
       protected
         procedure DoRelocationFixup(objsec:TObjSection);override;
         procedure DoRelocationFixup(objsec:TObjSection);override;
+        procedure Order_ObjSectionList(ObjSectionList : TFPObjectList;const aPattern:string);override;
         function writeData:boolean;override;
         function writeData:boolean;override;
       public
       public
         constructor create;override;
         constructor create;override;
@@ -1673,6 +1674,21 @@ implementation
           end;
           end;
       end;
       end;
 
 
+    function IOmfObjSectionClassNameCompare(Item1, Item2: Pointer): Integer;
+      var
+        I1 : TOmfObjSection absolute Item1;
+        I2 : TOmfObjSection absolute Item2;
+      begin
+        Result:=CompareStr(I1.ClassName,I2.ClassName);
+        if Result=0 then
+          Result:=CompareStr(I1.Name,I2.Name);
+      end;
+
+    procedure TMZExeOutput.Order_ObjSectionList(ObjSectionList: TFPObjectList; const aPattern: string);
+      begin
+        ObjSectionList.Sort(@IOmfObjSectionClassNameCompare);
+      end;
+
     function TMZExeOutput.writeData: boolean;
     function TMZExeOutput.writeData: boolean;
       var
       var
         Header: TMZExeHeader;
         Header: TMZExeHeader;