+ added an TNewExeOutput.Order_ObjSectionList override and sort obj sections by

class name first, then by name, then by initial order

git-svn-id: trunk@42551 -
This commit is contained in:
nickysn 2019-08-01 15:52:19 +00:00
parent b768673e96
commit d10fb705e4

View File

@ -481,6 +481,7 @@ interface
procedure AddImportLibrariesExtractedFromObjectModules;
protected
procedure DoRelocationFixup(objsec:TObjSection);override;
procedure Order_ObjSectionList(ObjSectionList : TFPObjectList;const aPattern:string);override;
public
constructor create;override;
destructor destroy;override;
@ -3577,6 +3578,27 @@ cleanup:
{todo}
end;
function INewExeOmfObjSectionClassNameCompare(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);
if Result=0 then
Result:=I1.SortOrder-I2.SortOrder;
end;
procedure TNewExeOutput.Order_ObjSectionList(ObjSectionList: TFPObjectList;const aPattern: string);
var
i: Integer;
begin
for i:=0 to ObjSectionList.Count-1 do
TOmfObjSection(ObjSectionList[i]).SortOrder:=i;
ObjSectionList.Sort(@INewExeOmfObjSectionClassNameCompare);
end;
constructor TNewExeOutput.create;
begin
inherited create;