ソースを参照

* unused coff symbols are removed by internal linker.

git-svn-id: trunk@5251 -
yury 19 年 前
コミット
aa9c217f6b
1 ファイル変更11 行追加0 行削除
  1. 11 0
      compiler/ogcoff.pas

+ 11 - 0
compiler/ogcoff.pas

@@ -2031,11 +2031,22 @@ const pemagic : array[0..3] of byte = (
 
 
     procedure tcoffexeoutput.CalcPos_Symbols;
+      var
+        i : integer;
+        sym : TExeSymbol;
       begin
         nsyms:=0;
         sympos:=0;
         if not(cs_link_strip in current_settings.globalswitches) then
          begin
+           { Removing unused symbols }
+           for i:=0 to ExeSymbolList.Count-1 do
+             begin
+               sym:=TExeSymbol(ExeSymbolList[i]);
+               if not sym.ObjSymbol.objsection.Used then
+                 ExeSymbolList.Delete(i);
+             end;
+           ExeSymbolList.Pack;
            nsyms:=ExeSymbolList.Count;
            sympos:=CurrDataPos;
            inc(CurrDataPos,sizeof(coffsymbol)*nsyms);