]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - ld/ldfile.c
[gdb/build] Cleanup gdb/features/feature_to_c.sh
[thirdparty/binutils-gdb.git] / ld / ldfile.c
index c8a6874978b3653143dc81b40d02028d6c27433d..f1107a1b7d793a51ea7f6f7a6b492db518992bf4 100644 (file)
@@ -1,5 +1,5 @@
 /* Linker file opening and searching.
-   Copyright (C) 1991-2023 Free Software Foundation, Inc.
+   Copyright (C) 1991-2024 Free Software Foundation, Inc.
 
    This file is part of the GNU Binutils.
 
@@ -199,7 +199,7 @@ ldfile_add_remap_file (const char * file)
          continue;
        }
 
-      char * rename = p;
+      char * renamed = p;
 
       /* Advance past the rename entry.  */
       while (*p && *p != '=' && *p != ' ' && *p != '\t' && *p != '\f'
@@ -208,7 +208,7 @@ ldfile_add_remap_file (const char * file)
       /* And terminate it.  */
       *p = '\0';
 
-      ldfile_add_remap (pattern, rename);
+      ldfile_add_remap (pattern, renamed);
     }
   while (! feof (f));
 
@@ -353,7 +353,9 @@ ldfile_try_open_bfd (const char *attempt,
     }
 
   /* PR 30568: Do not track lto generated temporary object files.  */
+#if BFD_SUPPORTS_PLUGINS
   if (!entry->flags.lto_output)
+#endif
     track_dependency_files (attempt);
 
   /* Linker needs to decompress sections.  */
@@ -741,7 +743,10 @@ try_open (const char *name, bool *sysrooted)
   result = fopen (name, "r");
 
   if (result != NULL)
-    *sysrooted = is_sysrooted_pathname (name);
+    {
+      *sysrooted = is_sysrooted_pathname (name);
+      track_dependency_files (name);
+    }
 
   if (verbose)
     {
@@ -866,19 +871,7 @@ ldfile_find_command_file (const char *name,
   return result;
 }
 
-enum script_open_style {
-  script_nonT,
-  script_T,
-  script_defaultT
-};
-
-struct script_name_list
-{
-  struct script_name_list *next;
-  enum script_open_style open_how;
-  char name[1];
-};
-
+struct script_name_list *processed_scripts = NULL;
 /* Open command file NAME.  */
 
 static void
@@ -886,7 +879,6 @@ ldfile_open_command_file_1 (const char *name, enum script_open_style open_how)
 {
   FILE *ldlex_input_stack;
   bool sysrooted;
-  static struct script_name_list *processed_scripts = NULL;
   struct script_name_list *script;
   size_t len;
 
@@ -923,8 +915,6 @@ ldfile_open_command_file_1 (const char *name, enum script_open_style open_how)
       return;
     }
 
-  track_dependency_files (name);
-
   lex_push_file (ldlex_input_stack, name, sysrooted);
 
   lineno = 1;