Procházet zdrojové kódy

+ introduce the omf_section_primary_group function. Use it instead of
section_belongs_to_dgroup, to allow sections to belong to groups, other than
dgroup.

git-svn-id: trunk@39268 -

nickysn před 7 roky
rodič
revize
ab47c8b899
3 změnil soubory, kde provedl 18 přidání a 5 odebrání
  1. 1 2
      compiler/ogomf.pas
  2. 13 0
      compiler/omfbase.pas
  3. 4 3
      compiler/x86/agx86nsm.pas

+ 1 - 2
compiler/ogomf.pas

@@ -644,8 +644,7 @@ implementation
             TOmfObjSection(Result).FUse:=suUse32;
             TOmfObjSection(Result).SizeLimit:=high(longword);
           end;
-        if section_belongs_to_dgroup(atype) then
-          TOmfObjSection(Result).FPrimaryGroup:='DGROUP';
+        TOmfObjSection(Result).FPrimaryGroup:=omf_section_primary_group(atype);
       end;
 
     function TOmfObjData.reffardatasection: TObjSection;

+ 13 - 0
compiler/omfbase.pas

@@ -1263,6 +1263,7 @@ interface
   { returns whether the specified section type belongs to the group DGROUP in
     the current memory model. DGROUP is the segment group pointed by DS }
   function section_belongs_to_dgroup(atype:TAsmSectiontype): Boolean;
+  function omf_section_primary_group(atype:TAsmSectiontype):string;
 
 implementation
 
@@ -2872,4 +2873,16 @@ implementation
 {$endif i8086}
     end;
 
+  function omf_section_primary_group(atype: TAsmSectiontype): string;
+    begin
+{$ifdef i8086}
+      if section_belongs_to_dgroup(atype) then
+        result:='DGROUP'
+      else
+        result:='';
+{$else i8086}
+      result:='';
+{$endif i8086}
+    end;
+
 end.

+ 4 - 3
compiler/x86/agx86nsm.pas

@@ -559,7 +559,7 @@ interface
           '.heap'
         );
       var
-        secname: string;
+        secname,secgroup: string;
       begin
         writer.AsmLn;
         writer.AsmWrite('SECTION ');
@@ -596,8 +596,9 @@ interface
                 writer.AsmWrite(' class='+omf_segclass(atype)+
                   ' align='+tostr(omf_sectiontype2align(atype)));
                 TX86NasmSection.Create(FSections,secname);
-                if section_belongs_to_dgroup(atype) then
-                  AddSegmentToGroup('DGROUP',secname);
+                secgroup:=omf_section_primary_group(atype);
+                if secgroup<>'' then
+                  AddSegmentToGroup(secgroup,secname);
               end;
           end
         else if secnames[atype]='.text' then