ソースを参照

+ introduced TExeSection.MemPosStr - a virtual method for converting the
section's memory position to string for the linker map file. This can be
overriden e.g. for segmented exe formats.

git-svn-id: trunk@42564 -

nickysn 6 年 前
コミット
3ebcef32ba
2 ファイル変更9 行追加1 行削除
  1. 8 0
      compiler/ogbase.pas
  2. 1 1
      compiler/ogmap.pas

+ 8 - 0
compiler/ogbase.pas

@@ -523,6 +523,8 @@ interface
         constructor create(AList:TFPHashObjectList;const AName:string);virtual;
         destructor  destroy;override;
         procedure AddObjSection(objsec:TObjSection;ignoreprops:boolean=false);virtual;
+        { string representation for the linker map file }
+        function MemPosStr(AImageBase: qword): string;virtual;
         property ObjSectionList:TFPObjectList read FObjSectionList;
         property SecSymIdx:longint read FSecSymIdx write FSecSymIdx;
       end;
@@ -1772,6 +1774,12 @@ implementation
       end;
 
 
+    function TExeSection.MemPosStr(AImageBase: qword): string;
+      begin
+        result:='0x'+HexStr(mempos+AImageBase,sizeof(pint)*2);
+      end;
+
+
 {****************************************************************************
                                 TStaticLibrary
 ****************************************************************************}

+ 1 - 1
compiler/ogmap.pas

@@ -164,7 +164,7 @@ implementation
      procedure TExeMap.AddMemoryMapExeSection(p:texesection);
        begin
          { .text           0x000018a8     0xd958 }
-         Add(PadSpace(p.name,15)+PadSpace(' 0x'+HexStr(p.mempos+Fimagebase,sizeof(pint)*2),12)+
+         Add(PadSpace(p.name,15)+PadSpace(' '+p.MemPosStr(Fimagebase),12)+
              ' '+PadSpaceLeft(sizestr(p.size),9));
        end;