Browse Source

Don't resolve __ld_has_* too early no matter whether it is true or not. Unused section removal can change it from TRUE back to FALSE.

git-svn-id: file:///var/svn/tigccpp/trunk/tigcc/ld-tigcc@278 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler 19 years ago
parent
commit
3fa468d5b6
1 changed files with 6 additions and 2 deletions
  1. 6 2
      special.c

+ 6 - 2
special.c

@@ -630,8 +630,12 @@ BOOLEAN ResolveSpecialSymbolLocation (SECTION *Section, LOCATION *Location, BOOL
 			// Resolve "has_...s".
 			else if ((!(strncmp (SymName, "has_", sizeof ("has_") - 1))) && (SymName [SymNameLength - 1] == 's'))
 			{
-				if (GetBuiltinValue (Program, SymName + (sizeof ("has_") - 1), SymNameLength - 1 - (sizeof ("has_") - 1), &NewValue, -1))
-					HasValue = (NewValue || Program->ResolveAllBuiltins);
+				if (Program->ResolveAllBuiltins)
+				{
+					Program->Frozen = TRUE;
+					if (GetBuiltinValue (Program, SymName + (sizeof ("has_") - 1), SymNameLength - 1 - (sizeof ("has_") - 1), &NewValue, -1))
+						HasValue = TRUE;
+				}
 			}
 			// Resolve "..._count".
 			else if ((SymNameLength > ((SIZE) (sizeof ("_count") - 1))) && (!(strcmp (SymName + SymNameLength - (sizeof ("_count") - 1), "_count"))))