mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-04 20:19:29 +01:00
* 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:
parent
185e34915c
commit
80bbd388f9
@ -1270,6 +1270,7 @@ Implementation
|
|||||||
{ Calc positions in mem }
|
{ Calc positions in mem }
|
||||||
ParseScript_MemPos;
|
ParseScript_MemPos;
|
||||||
exeoutput.FixupRelocations;
|
exeoutput.FixupRelocations;
|
||||||
|
exeoutput.RemoveUnusedExeSymbols;
|
||||||
exeoutput.PrintMemoryMap;
|
exeoutput.PrintMemoryMap;
|
||||||
if ErrorCount>0 then
|
if ErrorCount>0 then
|
||||||
goto myexit;
|
goto myexit;
|
||||||
|
|||||||
@ -486,6 +486,7 @@ interface
|
|||||||
procedure PrintMemoryMap;
|
procedure PrintMemoryMap;
|
||||||
procedure FixupSymbols;
|
procedure FixupSymbols;
|
||||||
procedure FixupRelocations;
|
procedure FixupRelocations;
|
||||||
|
procedure RemoveUnusedExeSymbols;
|
||||||
procedure MergeStabs;
|
procedure MergeStabs;
|
||||||
procedure RemoveUnreferencedSections;
|
procedure RemoveUnreferencedSections;
|
||||||
procedure RemoveEmptySections;
|
procedure RemoveEmptySections;
|
||||||
@ -2016,18 +2017,7 @@ implementation
|
|||||||
|
|
||||||
|
|
||||||
procedure TExeOutput.DataPos_Symbols;
|
procedure TExeOutput.DataPos_Symbols;
|
||||||
var
|
|
||||||
i : longint;
|
|
||||||
sym : TExeSymbol;
|
|
||||||
begin
|
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;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -2857,6 +2847,22 @@ implementation
|
|||||||
end;
|
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);
|
procedure TExeOutput.SetCurrMemPos(const AValue: qword);
|
||||||
begin
|
begin
|
||||||
if AValue>MaxMemPos then
|
if AValue>MaxMemPos then
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user