* Made removal of unused ExeSymbols a separate procedure, call it earlier and regardless of presence of the 'SYMBOLS' directive in the linker script.

git-svn-id: trunk@21727 -
This commit is contained in:
sergei 2012-06-27 20:26:49 +00:00
parent 185e34915c
commit 80bbd388f9
2 changed files with 18 additions and 11 deletions

View File

@ -1270,6 +1270,7 @@ Implementation
{ Calc positions in mem }
ParseScript_MemPos;
exeoutput.FixupRelocations;
exeoutput.RemoveUnusedExeSymbols;
exeoutput.PrintMemoryMap;
if ErrorCount>0 then
goto myexit;

View File

@ -486,6 +486,7 @@ interface
procedure PrintMemoryMap;
procedure FixupSymbols;
procedure FixupRelocations;
procedure RemoveUnusedExeSymbols;
procedure MergeStabs;
procedure RemoveUnreferencedSections;
procedure RemoveEmptySections;
@ -2016,18 +2017,7 @@ implementation
procedure TExeOutput.DataPos_Symbols;
var
i : longint;
sym : TExeSymbol;
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[i]:=nil;
end;
ExeSymbolList.Pack;
end;
@ -2857,6 +2847,22 @@ implementation
end;
procedure TExeOutput.RemoveUnusedExeSymbols;
var
i : longint;
sym : TExeSymbol;
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[i]:=nil;
end;
ExeSymbolList.Pack;
end;
procedure TExeOutput.SetCurrMemPos(const AValue: qword);
begin
if AValue>MaxMemPos then