// 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.
// 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,
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()
this->reopen_descriptor();
return this->descriptor_;
}
-
+
// Return the file last modification time. Calls gold_fatal if the stat
// system call failed.
Timespec
// --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
{