Browse Source

Don't set the Referenced flag for sections which don't need to become GC roots, nor after RemoveUnusedSections.

git-svn-id: file:///var/svn/tigccpp/trunk/tigcc/ld-tigcc@149 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler 19 years ago
parent
commit
9aae89ffb0
6 changed files with 1 additions and 14 deletions
  1. 0 1
      constmrg.c
  2. 0 1
      insert/ins_def.c
  3. 0 1
      insert/kernel.c
  4. 0 1
      insert/other.c
  5. 1 9
      manip.c
  6. 0 1
      special.c

+ 0 - 1
constmrg.c

@@ -182,7 +182,6 @@ OutOfMem:
 						Section->Parent = Program;
 						Section->Initialized = TRUE;
 						Section->Mergeable = TRUE;
-						Section->Referenced = TRUE;
 						Section->Size = max (Constant1Length, Constant2Length);
 						Section->Data = malloc (Section->Size);
 						if (!Section->Data)

+ 0 - 1
insert/ins_def.c

@@ -38,7 +38,6 @@ RELOC *CreateProgramRelativeReloc (SECTION *Section, I1 **NewData, SECTION *Targ
 		Reloc->Target.Offset      = TargetLocation;
 		SetRelocProgramRelative (Reloc);
 		InsertReloc (Section, Reloc);
-		TargetSection->Referenced = TRUE;
 	}
 	else
 		Error (NULL, "Out of memory.");

+ 0 - 1
insert/kernel.c

@@ -551,7 +551,6 @@ BOOLEAN InsertKernelExports (SECTION *Section, BOOLEAN TrailingZeroBytes)
 								Reloc->Target.SymbolName = CurSymbol->Name;
 								SetRelocProgramRelative (Reloc);
 								InsertReloc (Section, Reloc);
-								CurSection->Referenced = TRUE;
 							}
 							else
 							{

+ 0 - 1
insert/other.c

@@ -102,7 +102,6 @@ BOOLEAN InsertNostubComments (SECTION *Section)
 										Reloc->Target.SymbolName = CurSymbol->Name;
 										SetRelocProgramRelative (Reloc);
 										InsertReloc (Section, Reloc);
-										CurSection->Referenced = TRUE;
 									}
 									else
 									{

+ 1 - 9
manip.c

@@ -460,13 +460,7 @@ void HandleLocation (RELOC *Reloc, LOCATION *Location)
 	if (Location)
 	{
 		SECTION *Section = Reloc->Parent;
-		if (Location->Symbol)
-		{
-			SECTION *RelationSection = Location->Symbol->Parent;
-			if (RelationSection != Section)
-				RelationSection->Referenced = TRUE;
-		}
-		else
+		if (!Location->Symbol)
 		{
 			Section->Relocs.UnresolvedCount++;
 		}
@@ -497,8 +491,6 @@ SYMBOL *ResolveLocation (PROGRAM *Program, SECTION *Section, LOCATION *Location)
 					// destination string.
 					Location->Symbol = CurSymbol;
 					FreeLocationSymbolName (Section, Location);
-					if (CurSection != Section)
-						CurSection->Referenced = TRUE;
 					return CurSymbol;
 				}
 			}

+ 0 - 1
special.c

@@ -848,7 +848,6 @@ BOOLEAN ResolveSpecialSymbolLocation (SECTION *Section, LOCATION *Location, BOOL
 					Location->Symbol = NewSymbol;
 					FreeLocationSymbolName (Section, Location);
 					Location->Offset += NewTargetOffset;
-					NewSymbol->Parent->Referenced = TRUE;
 				}
 				else
 					Location->Builtin = TRUE;