Add option to nm to change the characters displayed for ifunc symbols. Add a configu...
[binutils-gdb.git] / gold / fileread.h
index d2ac9276f3aa3b6b486a9dc2b3caf48c81c3dde7..2120135dea0c8fbd3463c5b5abfd72d90db061a7 100644 (file)
@@ -1,6 +1,6 @@
 // fileread.h -- read files for gold   -*- C++ -*-
 
-// Copyright 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+// Copyright (C) 2006-2020 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -52,6 +52,12 @@ struct Timespec
   int nanoseconds;
 };
 
+// Get the last modified time of an unopened file.  Returns false if the
+// file does not exist.
+
+bool
+get_mtime(const char* filename, Timespec* mtime);
+
 class Position_dependent_options;
 class Input_file_argument;
 class Dirsearch;
@@ -135,12 +141,13 @@ class File_read
   // SIZE bytes.  OFFSET is the offset into the input file for the
   // file we are reading; this is zero for a normal object file,
   // non-zero for an object file in an archive.  ALIGNED is true if
-  // the data must be naturally aligned; this only matters when OFFSET
-  // is not zero.  The pointer will remain valid until the File_read
-  // is unlocked.  It is an error if we can not read enough data from
-  // the file.  The CACHE parameter is a hint as to whether it will be
-  // useful to cache this data for later accesses--i.e., later calls
-  // to get_view, read, or get_lasting_view which retrieve the same
+  // the data must be naturally aligned (i.e., aligned to the size
+  // of a target word); this only matters when OFFSET is not zero.
+  // The pointer will remain valid until the File_read is unlocked.
+  // It is an error if we can not read enough data from the file.
+  // The CACHE parameter is a hint as to whether it will be useful
+  // to cache this data for later accesses--i.e., later calls to
+  // get_view, read, or get_lasting_view which retrieve the same
   // data.
   const unsigned char*
   get_view(off_t offset, off_t start, section_size_type size, bool aligned,
@@ -200,6 +207,15 @@ class File_read
   static void
   print_stats();
 
+  // Write the dependency file listing all files read.
+  static void
+  write_dependency_file(const char* dependency_file_name,
+                       const char* output_file_name);
+
+  // Record that a file was read.  File_read::open does this.
+  static void
+  record_file_read(const std::string& name);
+
   // Return the open file descriptor (for plugins).
   int
   descriptor()
@@ -207,7 +223,7 @@ class File_read
     this->reopen_descriptor();
     return this->descriptor_;
   }
-  
+
   // Return the file last modification time.  Calls gold_fatal if the stat
   // system call failed.
   Timespec
@@ -240,6 +256,9 @@ class File_read
   // --stats.
   static unsigned long long maximum_mapped_bytes;
 
+  // Set of names of all files read.
+  static std::vector<std::string> files_read;
+
   // A view into the file.
   class View
   {
@@ -487,6 +506,9 @@ class Input_file
       is_in_sysroot_(false), format_(FORMAT_NONE)
   { }
 
+  // Create an input file given just a filename.
+  Input_file(const char* name);
+
   // Create an input file with the contents already provided.  This is
   // only used for testing.  With this path, don't call the open
   // method.