mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 08:31:49 +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 } | ||||
|         ParseScript_MemPos; | ||||
|         exeoutput.FixupRelocations; | ||||
|         exeoutput.RemoveUnusedExeSymbols; | ||||
|         exeoutput.PrintMemoryMap; | ||||
|         if ErrorCount>0 then | ||||
|           goto myexit; | ||||
|  | ||||
| @ -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 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 sergei
						sergei