// fileread.h -- read files for gold -*- C++ -*-
-// Copyright 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of gold.
{
// Data owned by File object - nothing done in destructor.
DATA_NOT_OWNED,
- // Data alocated with new[] and owned by this object - should
+ // Data allocated with new[] and owned by this object - should
// use delete[].
DATA_ALLOCATED_ARRAY,
// Data mmapped and owned by this object - should munmap.
{ return (file_size + (page_size - 1)) & ~ (page_size - 1); }
// The maximum number of entries we will pass to ::readv.
-#ifdef HAVE_READV
static const size_t max_readv_entries = 128;
-#else
- // On targets that don't have readv set the max to 1 so readv is not
- // used.
- static const size_t max_readv_entries = 1;
-#endif
// Use readv to read data.
void
// restarted to find the next file with a matching name by
// incrementing the result and calling this again.
bool
- open(const Dirsearch&, const Task*, int *pindex);
+ open(const Dirsearch&, const Task*, int* pindex);
// Return the name given by the user. For -lc this will return "c".
const char*
format() const
{ return this->format_; }
+ // Try to find a file in the extra search dirs. Returns true on success.
+ static bool
+ try_extra_search_path(int* pindex,
+ const Input_file_argument* input_argument,
+ std::string filename, std::string* found_name,
+ std::string* namep);
+
+ // Find the actual file.
+ static bool
+ find_file(const Dirsearch& dirpath, int* pindex,
+ const Input_file_argument* input_argument,
+ bool* is_in_sysroot,
+ std::string* found_name, std::string* namep);
+
private:
Input_file(const Input_file&);
Input_file& operator=(const Input_file&);