* Replaced oso_disabled flag by TExeSection.Disabled boolean property. Makes code a bit nicer to read.

git-svn-id: trunk@24361 -
This commit is contained in:
sergei 2013-04-28 20:29:49 +00:00
parent 8e6d6d0027
commit 1fea5a82c1
4 changed files with 13 additions and 14 deletions

View File

@ -142,8 +142,6 @@ interface
oso_debug,
{ Contains only strings }
oso_strings,
{ Ignore this section }
oso_disabled,
{ Must be cloned when writing separate debug file }
oso_debug_copy
);
@ -418,6 +416,7 @@ interface
DataPos,
MemPos : aword;
SecAlign : shortint;
Disabled : boolean;
SecOptions : TObjSectionOptions;
constructor create(AList:TFPHashObjectList;const AName:string);virtual;
destructor destroy;override;
@ -2963,7 +2962,7 @@ implementation
if doremove then
begin
Comment(V_Debug,'Disabling empty section '+exesec.name);
exesec.SecOptions:=exesec.SecOptions+[oso_disabled];
exesec.Disabled:=true;
end;
end;
end;
@ -2977,7 +2976,7 @@ implementation
for i:=0 to ExeSectionList.Count-1 do
begin
exesec:=TExeSection(ExeSectionList[i]);
if (oso_disabled in exesec.SecOptions) then
if exesec.Disabled then
ExeSectionList[i]:=nil;
end;
ExeSectionList.Pack;

View File

@ -2793,7 +2793,7 @@ const pemagic : array[0..3] of byte = (
exesec:=FindExeSection('.reloc');
if exesec=nil then
InternalError(2012072401);
exesec.SecOptions:=exesec.SecOptions-[oso_disabled];
exesec.Disabled:=false;
end;
inherited;
end;

View File

@ -2491,22 +2491,22 @@ implementation
{ Re-enable sections which end up to contain some data
(.got, .rel[a].dyn, .rel[a].plt (includes .rel[a].iplt) and .hash }
if gotobjsec.size<>0 then
Exclude(gotobjsec.ExeSection.SecOptions,oso_disabled);
gotobjsec.ExeSection.Disabled:=false;
if assigned(dynrelocsec) and
((dynrelocsec.size<>0) or (dyncopysyms.count<>0)) then
Exclude(dynrelocsec.ExeSection.SecOptions,oso_disabled);
dynrelocsec.ExeSection.Disabled:=false;
if assigned(pltrelocsec) and (pltrelocsec.size>0) then
Exclude(pltrelocsec.ExeSection.SecOptions,oso_disabled);
pltrelocsec.ExeSection.Disabled:=false;
if assigned(ipltrelocsec) and (ipltrelocsec.size>0) then
Exclude(ipltrelocsec.ExeSection.SecOptions,oso_disabled);
ipltrelocsec.ExeSection.Disabled:=false;
if assigned(hashobjsec) then
Exclude(hashobjsec.ExeSection.SecOptions,oso_disabled);
hashobjsec.ExeSection.Disabled:=false;
if assigned(symversec) and (symversec.size<>0) then
Exclude(symversec.ExeSection.SecOptions,oso_disabled);
symversec.ExeSection.Disabled:=false;
if assigned(verneedsec) and (verneedsec.size<>0) then
Exclude(verneedsec.ExeSection.SecOptions,oso_disabled);
verneedsec.ExeSection.Disabled:=false;
if assigned(verdefsec) and (verdefsec.size<>0) then
Exclude(verneedsec.ExeSection.SecOptions,oso_disabled);
verdefsec.ExeSection.Disabled:=false;
RemoveDisabledSections;
MapSectionsToSegments;

View File

@ -1227,7 +1227,7 @@ function SecOpts(SecOptions:TObjSectionOptions):string;
exesec:=FindExeSection('.reloc');
if exesec=nil then
InternalError(2012072602);
exesec.SecOptions:=exesec.SecOptions-[oso_disabled];
exesec.Disabled:=false;
inherited;
end;