Procházet zdrojové kódy

+ added property TObjSymbol.group for use with the omf object format

git-svn-id: trunk@31312 -
nickysn před 10 roky
rodič
revize
9fc100574c
2 změnil soubory, kde provedl 10 přidání a 2 odebrání
  1. 4 2
      compiler/ogbase.pas
  2. 6 0
      compiler/ogomf.pas

+ 4 - 2
compiler/ogbase.pas

@@ -162,6 +162,8 @@ interface
 
      TObjSectionOptions = set of TObjSectionOption;
 
+     TObjSectionGroup = class;
+
      TObjSymbol = class(TFPHashObject)
      public
        bind       : TAsmsymbind;
@@ -180,6 +182,8 @@ interface
        { Darwin asm is using indirect symbols resolving }
        indsymbol  : TObjSymbol;
 
+       { Used by the OMF object format and its complicated relocation records }
+       group: TObjSectionGroup;
 {$ifdef ARM}
        ThumbFunc : boolean;
 {$endif ARM}
@@ -220,8 +224,6 @@ interface
         property typ: TObjRelocationType read GetType write SetType;
      end;
 
-     TObjSectionGroup = class;
-
      TObjSection = class(TFPHashObject)
      private
        FData       : TDynamicArray;

+ 6 - 0
compiler/ogomf.pas

@@ -1106,6 +1106,7 @@ implementation
         PubDefRec: TOmfRecord_PUBDEF;
         PubDefElem: TOmfPublicNameElement;
         OldCount,NewCount,i: Integer;
+        basegroup: TObjSectionGroup;
         objsym: TObjSymbol;
         objsec: TOmfObjSection;
       begin
@@ -1121,6 +1122,10 @@ implementation
             PubDefRec.Free;
             exit;
           end;
+        if PubDefRec.BaseGroupIndex<>0 then
+          basegroup:=TObjSectionGroup(objdata.GroupsList[PubDefRec.BaseGroupIndex-1])
+        else
+          basegroup:=nil;
         if (PubDefRec.BaseSegmentIndex<0) or (PubDefRec.BaseSegmentIndex>objdata.ObjSectionList.Count) then
           begin
             InputError('Public symbol''s segment name index out of range');
@@ -1140,6 +1145,7 @@ implementation
             objsym:=objdata.CreateSymbol(PubDefElem.Name);
             objsym.bind:=AB_GLOBAL;
             objsym.typ:=AT_FUNCTION;
+            objsym.group:=basegroup;
             objsym.objsection:=objsec;
             objsym.offset:=PubDefElem.PublicOffset;
             objsym.size:=0;