Forráskód Böngészése

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

git-svn-id: trunk@24361 -
sergei 12 éve
szülő
commit
1fea5a82c1
4 módosított fájl, 13 hozzáadás és 14 törlés
  1. 3 4
      compiler/ogbase.pas
  2. 1 1
      compiler/ogcoff.pas
  3. 8 8
      compiler/ogelf.pas
  4. 1 1
      compiler/ognlm.pas

+ 3 - 4
compiler/ogbase.pas

@@ -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;

+ 1 - 1
compiler/ogcoff.pas

@@ -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;

+ 8 - 8
compiler/ogelf.pas

@@ -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;

+ 1 - 1
compiler/ognlm.pas

@@ -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;