Commit | Line | Data |
---|---|---|
bae7f79e ILT |
1 | // fileread.h -- read files for gold -*- C++ -*- |
2 | ||
114dfbe1 | 3 | // Copyright 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
6cb15b7f ILT |
4 | // Written by Ian Lance Taylor <iant@google.com>. |
5 | ||
6 | // This file is part of gold. | |
7 | ||
8 | // This program is free software; you can redistribute it and/or modify | |
9 | // it under the terms of the GNU General Public License as published by | |
10 | // the Free Software Foundation; either version 3 of the License, or | |
11 | // (at your option) any later version. | |
12 | ||
13 | // This program is distributed in the hope that it will be useful, | |
14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | // GNU General Public License for more details. | |
17 | ||
18 | // You should have received a copy of the GNU General Public License | |
19 | // along with this program; if not, write to the Free Software | |
20 | // Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, | |
21 | // MA 02110-1301, USA. | |
22 | ||
bae7f79e ILT |
23 | // Classes used to read data from binary input files. |
24 | ||
25 | #ifndef GOLD_FILEREAD_H | |
26 | #define GOLD_FILEREAD_H | |
27 | ||
bae7f79e | 28 | #include <list> |
ead1e424 ILT |
29 | #include <map> |
30 | #include <string> | |
0c0a7411 | 31 | #include <vector> |
bae7f79e | 32 | |
17a1d0a9 | 33 | #include "token.h" |
bae7f79e ILT |
34 | |
35 | namespace gold | |
36 | { | |
37 | ||
98fa85cb ILT |
38 | // Since not all system supports stat.st_mtim and struct timespec, |
39 | // we define our own structure and fill the nanoseconds if we can. | |
40 | ||
41 | struct Timespec | |
42 | { | |
43 | Timespec() | |
44 | : seconds(0), nanoseconds(0) | |
45 | { } | |
46 | ||
47 | Timespec(time_t a_seconds, int a_nanoseconds) | |
48 | : seconds(a_seconds), nanoseconds(a_nanoseconds) | |
49 | { } | |
50 | ||
51 | time_t seconds; | |
52 | int nanoseconds; | |
53 | }; | |
54 | ||
14144f39 ILT |
55 | class Position_dependent_options; |
56 | class Input_file_argument; | |
bae7f79e | 57 | class Dirsearch; |
bae7f79e ILT |
58 | class File_view; |
59 | ||
2a00e4fb ILT |
60 | // File_read manages a file descriptor and mappings for a file we are |
61 | // reading. | |
bae7f79e ILT |
62 | |
63 | class File_read | |
64 | { | |
65 | public: | |
66 | File_read() | |
2a00e4fb | 67 | : name_(), descriptor_(-1), is_descriptor_opened_(false), object_count_(0), |
2c849493 ILT |
68 | size_(0), token_(false), views_(), saved_views_(), mapped_bytes_(0), |
69 | released_(true), whole_file_view_(NULL) | |
bae7f79e | 70 | { } |
5a6f7e2d | 71 | |
bae7f79e ILT |
72 | ~File_read(); |
73 | ||
74 | // Open a file. | |
75 | bool | |
17a1d0a9 | 76 | open(const Task*, const std::string& name); |
bae7f79e | 77 | |
5a6f7e2d ILT |
78 | // Pretend to open the file, but provide the file contents. No |
79 | // actual file system activity will occur. This is used for | |
80 | // testing. | |
81 | bool | |
17a1d0a9 ILT |
82 | open(const Task*, const std::string& name, const unsigned char* contents, |
83 | off_t size); | |
5a6f7e2d | 84 | |
bae7f79e ILT |
85 | // Return the file name. |
86 | const std::string& | |
87 | filename() const | |
88 | { return this->name_; } | |
89 | ||
cb295612 ILT |
90 | // Add an object associated with a file. |
91 | void | |
92 | add_object() | |
93 | { ++this->object_count_; } | |
94 | ||
95 | // Remove an object associated with a file. | |
96 | void | |
97 | remove_object() | |
98 | { --this->object_count_; } | |
99 | ||
17a1d0a9 | 100 | // Lock the file for exclusive access within a particular Task::run |
2a00e4fb ILT |
101 | // execution. This routine may only be called when the workqueue |
102 | // lock is held. | |
bae7f79e | 103 | void |
17a1d0a9 | 104 | lock(const Task* t); |
bae7f79e | 105 | |
2a00e4fb | 106 | // Unlock the file. |
bae7f79e | 107 | void |
17a1d0a9 | 108 | unlock(const Task* t); |
4973341a | 109 | |
bae7f79e ILT |
110 | // Test whether the object is locked. |
111 | bool | |
7004837e | 112 | is_locked() const; |
bae7f79e | 113 | |
17a1d0a9 ILT |
114 | // Return the token, so that the task can be queued. |
115 | Task_token* | |
116 | token() | |
117 | { return &this->token_; } | |
118 | ||
119 | // Release the file. This indicates that we aren't going to do | |
120 | // anything further with it until it is unlocked. This is used | |
121 | // because a Task which locks the file never calls either lock or | |
122 | // unlock; it just locks the token. The basic rule is that a Task | |
123 | // which locks a file via the Task::locks interface must explicitly | |
124 | // call release() when it is done. This is not necessary for code | |
125 | // which calls unlock() on the file. | |
126 | void | |
127 | release(); | |
128 | ||
82dcae9d ILT |
129 | // Return the size of the file. |
130 | off_t | |
131 | filesize() const | |
132 | { return this->size_; } | |
133 | ||
ba45d247 | 134 | // Return a view into the file starting at file offset START for |
39d0cb0e ILT |
135 | // SIZE bytes. OFFSET is the offset into the input file for the |
136 | // file we are reading; this is zero for a normal object file, | |
137 | // non-zero for an object file in an archive. ALIGNED is true if | |
138 | // the data must be naturally aligned; this only matters when OFFSET | |
139 | // is not zero. The pointer will remain valid until the File_read | |
140 | // is unlocked. It is an error if we can not read enough data from | |
141 | // the file. The CACHE parameter is a hint as to whether it will be | |
9eb9fa57 ILT |
142 | // useful to cache this data for later accesses--i.e., later calls |
143 | // to get_view, read, or get_lasting_view which retrieve the same | |
144 | // data. | |
bae7f79e | 145 | const unsigned char* |
39d0cb0e ILT |
146 | get_view(off_t offset, off_t start, section_size_type size, bool aligned, |
147 | bool cache); | |
bae7f79e | 148 | |
ba45d247 ILT |
149 | // Read data from the file into the buffer P starting at file offset |
150 | // START for SIZE bytes. | |
151 | void | |
2a00e4fb | 152 | read(off_t start, section_size_type size, void* p); |
ba45d247 | 153 | |
ba45d247 ILT |
154 | // Return a lasting view into the file starting at file offset START |
155 | // for SIZE bytes. This is allocated with new, and the caller is | |
156 | // responsible for deleting it when done. The data associated with | |
157 | // this view will remain valid until the view is deleted. It is an | |
39d0cb0e ILT |
158 | // error if we can not read enough data from the file. The OFFSET, |
159 | // ALIGNED and CACHE parameters are as in get_view. | |
bae7f79e | 160 | File_view* |
39d0cb0e ILT |
161 | get_lasting_view(off_t offset, off_t start, section_size_type size, |
162 | bool aligned, bool cache); | |
bae7f79e | 163 | |
cb295612 ILT |
164 | // Mark all views as no longer cached. |
165 | void | |
166 | clear_view_cache_marks(); | |
167 | ||
39d0cb0e ILT |
168 | // Discard all uncached views. This is normally done by release(), |
169 | // but not for objects in archives. FIXME: This is a complicated | |
170 | // interface, and it would be nice to have something more automatic. | |
171 | void | |
172 | clear_uncached_views() | |
a2a5469e | 173 | { this->clear_views(CLEAR_VIEWS_ARCHIVE); } |
39d0cb0e | 174 | |
cb295612 ILT |
175 | // A struct used to do a multiple read. |
176 | struct Read_multiple_entry | |
177 | { | |
178 | // The file offset of the data to read. | |
179 | off_t file_offset; | |
180 | // The amount of data to read. | |
181 | section_size_type size; | |
182 | // The buffer where the data should be placed. | |
183 | unsigned char* buffer; | |
184 | ||
185 | Read_multiple_entry(off_t o, section_size_type s, unsigned char* b) | |
186 | : file_offset(o), size(s), buffer(b) | |
187 | { } | |
188 | }; | |
189 | ||
190 | typedef std::vector<Read_multiple_entry> Read_multiple; | |
191 | ||
192 | // Read a bunch of data from the file into various different | |
193 | // locations. The vector must be sorted by ascending file_offset. | |
194 | // BASE is a base offset to be added to all the offsets in the | |
195 | // vector. | |
196 | void | |
197 | read_multiple(off_t base, const Read_multiple&); | |
198 | ||
e44fcf3b ILT |
199 | // Dump statistical information to stderr. |
200 | static void | |
201 | print_stats(); | |
202 | ||
89fc3421 CC |
203 | // Return the open file descriptor (for plugins). |
204 | int | |
0f7c0701 | 205 | descriptor() |
89fc3421 | 206 | { |
0f7c0701 | 207 | this->reopen_descriptor(); |
89fc3421 CC |
208 | return this->descriptor_; |
209 | } | |
98fa85cb ILT |
210 | |
211 | // Return the file last modification time. Calls gold_fatal if the stat | |
212 | // system call failed. | |
213 | Timespec | |
214 | get_mtime(); | |
89fc3421 | 215 | |
bae7f79e | 216 | private: |
a2a5469e CC |
217 | // Control for what views to clear. |
218 | enum Clear_views_mode | |
219 | { | |
220 | // Clear uncached views not used by an archive. | |
221 | CLEAR_VIEWS_NORMAL, | |
222 | // Clear all uncached views (including in an archive). | |
223 | CLEAR_VIEWS_ARCHIVE, | |
224 | // Clear all views (i.e., we're destroying the file). | |
225 | CLEAR_VIEWS_ALL | |
226 | }; | |
227 | ||
bae7f79e ILT |
228 | // This class may not be copied. |
229 | File_read(const File_read&); | |
230 | File_read& operator=(const File_read&); | |
231 | ||
114dfbe1 | 232 | // Total bytes mapped into memory during the link if --stats. |
e44fcf3b ILT |
233 | static unsigned long long total_mapped_bytes; |
234 | ||
114dfbe1 ILT |
235 | // Current number of bytes mapped into memory during the link if |
236 | // --stats. | |
e44fcf3b ILT |
237 | static unsigned long long current_mapped_bytes; |
238 | ||
114dfbe1 ILT |
239 | // High water mark of bytes mapped into memory during the link if |
240 | // --stats. | |
e44fcf3b ILT |
241 | static unsigned long long maximum_mapped_bytes; |
242 | ||
d1038c21 | 243 | // A view into the file. |
bae7f79e ILT |
244 | class View |
245 | { | |
246 | public: | |
2c849493 ILT |
247 | // Specifies how to dispose the data on destruction of the view. |
248 | enum Data_ownership | |
249 | { | |
250 | // Data owned by File object - nothing done in destructor. | |
251 | DATA_NOT_OWNED, | |
252 | // Data alocated with new[] and owned by this object - should | |
253 | // use delete[]. | |
254 | DATA_ALLOCATED_ARRAY, | |
255 | // Data mmapped and owned by this object - should munmap. | |
256 | DATA_MMAPPED | |
257 | }; | |
258 | ||
2ea97941 ILT |
259 | View(off_t start, section_size_type size, const unsigned char* data, |
260 | unsigned int byteshift, bool cache, Data_ownership data_ownership) | |
261 | : start_(start), size_(size), data_(data), lock_count_(0), | |
262 | byteshift_(byteshift), cache_(cache), data_ownership_(data_ownership), | |
2c849493 | 263 | accessed_(true) |
bae7f79e ILT |
264 | { } |
265 | ||
266 | ~View(); | |
267 | ||
268 | off_t | |
269 | start() const | |
270 | { return this->start_; } | |
271 | ||
8383303e | 272 | section_size_type |
bae7f79e ILT |
273 | size() const |
274 | { return this->size_; } | |
275 | ||
e214a02b | 276 | const unsigned char* |
bae7f79e ILT |
277 | data() const |
278 | { return this->data_; } | |
279 | ||
280 | void | |
281 | lock(); | |
282 | ||
283 | void | |
284 | unlock(); | |
285 | ||
286 | bool | |
287 | is_locked(); | |
288 | ||
39d0cb0e ILT |
289 | unsigned int |
290 | byteshift() const | |
291 | { return this->byteshift_; } | |
292 | ||
9eb9fa57 ILT |
293 | void |
294 | set_cache() | |
295 | { this->cache_ = true; } | |
296 | ||
cb295612 ILT |
297 | void |
298 | clear_cache() | |
299 | { this->cache_ = false; } | |
300 | ||
9eb9fa57 ILT |
301 | bool |
302 | should_cache() const | |
303 | { return this->cache_; } | |
304 | ||
cb295612 ILT |
305 | void |
306 | set_accessed() | |
307 | { this->accessed_ = true; } | |
308 | ||
309 | void | |
310 | clear_accessed() | |
311 | { this->accessed_= false; } | |
312 | ||
313 | bool | |
314 | accessed() const | |
315 | { return this->accessed_; } | |
316 | ||
a2a5469e CC |
317 | // Returns TRUE if this view contains permanent data -- e.g., data that |
318 | // was supplied by the owner of the File object. | |
319 | bool | |
320 | is_permanent_view() const | |
321 | { return this->data_ownership_ == DATA_NOT_OWNED; } | |
322 | ||
bae7f79e ILT |
323 | private: |
324 | View(const View&); | |
325 | View& operator=(const View&); | |
326 | ||
39d0cb0e | 327 | // The file offset of the start of the view. |
bae7f79e | 328 | off_t start_; |
39d0cb0e | 329 | // The size of the view. |
8383303e | 330 | section_size_type size_; |
39d0cb0e | 331 | // A pointer to the actual bytes. |
e214a02b | 332 | const unsigned char* data_; |
39d0cb0e | 333 | // The number of locks on this view. |
bae7f79e | 334 | int lock_count_; |
39d0cb0e ILT |
335 | // The number of bytes that the view is shifted relative to the |
336 | // underlying file. This is used to align data. This is normally | |
337 | // zero, except possibly for an object in an archive. | |
338 | unsigned int byteshift_; | |
339 | // Whether the view is cached. | |
9eb9fa57 | 340 | bool cache_; |
39d0cb0e ILT |
341 | // Whether the view is mapped into memory. If not, data_ points |
342 | // to memory allocated using new[]. | |
2c849493 | 343 | Data_ownership data_ownership_; |
39d0cb0e | 344 | // Whether the view has been accessed recently. |
cb295612 | 345 | bool accessed_; |
bae7f79e ILT |
346 | }; |
347 | ||
e44fcf3b | 348 | friend class View; |
bae7f79e ILT |
349 | friend class File_view; |
350 | ||
39d0cb0e ILT |
351 | // The type of a mapping from page start and byte shift to views. |
352 | typedef std::map<std::pair<off_t, unsigned int>, View*> Views; | |
353 | ||
354 | // A simple list of Views. | |
355 | typedef std::list<View*> Saved_views; | |
356 | ||
2a00e4fb ILT |
357 | // Open the descriptor if necessary. |
358 | void | |
359 | reopen_descriptor(); | |
360 | ||
ead1e424 | 361 | // Find a view into the file. |
bae7f79e | 362 | View* |
39d0cb0e ILT |
363 | find_view(off_t start, section_size_type size, unsigned int byteshift, |
364 | View** vshifted) const; | |
bae7f79e | 365 | |
ead1e424 | 366 | // Read data from the file into a buffer. |
82dcae9d | 367 | void |
2a00e4fb | 368 | do_read(off_t start, section_size_type size, void* p); |
bae7f79e | 369 | |
39d0cb0e ILT |
370 | // Add a view. |
371 | void | |
372 | add_view(View*); | |
373 | ||
374 | // Make a view into the file. | |
375 | View* | |
376 | make_view(off_t start, section_size_type size, unsigned int byteshift, | |
377 | bool cache); | |
378 | ||
ead1e424 | 379 | // Find or make a view into the file. |
bae7f79e | 380 | View* |
39d0cb0e ILT |
381 | find_or_make_view(off_t offset, off_t start, section_size_type size, |
382 | bool aligned, bool cache); | |
bae7f79e | 383 | |
ead1e424 | 384 | // Clear the file views. |
bae7f79e | 385 | void |
a2a5469e | 386 | clear_views(Clear_views_mode); |
bae7f79e | 387 | |
ead1e424 ILT |
388 | // The size of a file page for buffering data. |
389 | static const off_t page_size = 8192; | |
390 | ||
391 | // Given a file offset, return the page offset. | |
392 | static off_t | |
393 | page_offset(off_t file_offset) | |
394 | { return file_offset & ~ (page_size - 1); } | |
395 | ||
396 | // Given a file size, return the size to read integral pages. | |
397 | static off_t | |
398 | pages(off_t file_size) | |
399 | { return (file_size + (page_size - 1)) & ~ (page_size - 1); } | |
400 | ||
cb295612 | 401 | // The maximum number of entries we will pass to ::readv. |
d9a893b8 | 402 | #ifdef HAVE_READV |
cb295612 | 403 | static const size_t max_readv_entries = 128; |
d9a893b8 ILT |
404 | #else |
405 | // On targets that don't have readv set the max to 1 so readv is not | |
406 | // used. | |
407 | static const size_t max_readv_entries = 1; | |
408 | #endif | |
cb295612 ILT |
409 | |
410 | // Use readv to read data. | |
411 | void | |
412 | do_readv(off_t base, const Read_multiple&, size_t start, size_t count); | |
413 | ||
ead1e424 | 414 | // File name. |
bae7f79e | 415 | std::string name_; |
ead1e424 | 416 | // File descriptor. |
bae7f79e | 417 | int descriptor_; |
2a00e4fb ILT |
418 | // Whether we have regained the descriptor after releasing the file. |
419 | bool is_descriptor_opened_; | |
cb295612 ILT |
420 | // The number of objects associated with this file. This will be |
421 | // more than 1 in the case of an archive. | |
422 | int object_count_; | |
82dcae9d ILT |
423 | // File size. |
424 | off_t size_; | |
17a1d0a9 ILT |
425 | // A token used to lock the file. |
426 | Task_token token_; | |
ead1e424 ILT |
427 | // Buffered views into the file. |
428 | Views views_; | |
429 | // List of views which were locked but had to be removed from views_ | |
430 | // because they were not large enough. | |
431 | Saved_views saved_views_; | |
e44fcf3b ILT |
432 | // Total amount of space mapped into memory. This is only changed |
433 | // while the file is locked. When we unlock the file, we transfer | |
434 | // the total to total_mapped_bytes, and reset this to zero. | |
435 | size_t mapped_bytes_; | |
17a1d0a9 ILT |
436 | // Whether the file was released. |
437 | bool released_; | |
2c849493 ILT |
438 | // A view containing the whole file. May be NULL if we mmap only |
439 | // the relevant parts of the file. Not NULL if: | |
440 | // - Flag --mmap_whole_files is set (default on 64-bit hosts). | |
441 | // - The contents was specified in the constructor. Used only for | |
442 | // testing purposes). | |
443 | View* whole_file_view_; | |
bae7f79e ILT |
444 | }; |
445 | ||
446 | // A view of file data that persists even when the file is unlocked. | |
447 | // Callers should destroy these when no longer required. These are | |
448 | // obtained form File_read::get_lasting_view. They may only be | |
449 | // destroyed when the underlying File_read is locked. | |
450 | ||
451 | class File_view | |
452 | { | |
453 | public: | |
454 | // This may only be called when the underlying File_read is locked. | |
455 | ~File_view(); | |
456 | ||
457 | // Return a pointer to the data associated with this view. | |
458 | const unsigned char* | |
459 | data() const | |
460 | { return this->data_; } | |
461 | ||
462 | private: | |
463 | File_view(const File_view&); | |
464 | File_view& operator=(const File_view&); | |
465 | ||
466 | friend class File_read; | |
467 | ||
468 | // Callers have to get these via File_read::get_lasting_view. | |
2ea97941 ILT |
469 | File_view(File_read& file, File_read::View* view, const unsigned char* data) |
470 | : file_(file), view_(view), data_(data) | |
bae7f79e ILT |
471 | { } |
472 | ||
473 | File_read& file_; | |
474 | File_read::View* view_; | |
475 | const unsigned char* data_; | |
476 | }; | |
477 | ||
bae7f79e ILT |
478 | // All the information we hold for a single input file. This can be |
479 | // an object file, a shared library, or an archive. | |
480 | ||
481 | class Input_file | |
482 | { | |
483 | public: | |
10165461 DK |
484 | enum Format |
485 | { | |
486 | FORMAT_NONE, | |
487 | FORMAT_ELF, | |
488 | FORMAT_BINARY | |
489 | }; | |
490 | ||
5a6f7e2d | 491 | Input_file(const Input_file_argument* input_argument) |
e2aacd2c | 492 | : input_argument_(input_argument), found_name_(), file_(), |
10165461 | 493 | is_in_sysroot_(false), format_(FORMAT_NONE) |
bae7f79e ILT |
494 | { } |
495 | ||
5a6f7e2d ILT |
496 | // Create an input file with the contents already provided. This is |
497 | // only used for testing. With this path, don't call the open | |
498 | // method. | |
17a1d0a9 ILT |
499 | Input_file(const Task*, const char* name, const unsigned char* contents, |
500 | off_t size); | |
5a6f7e2d | 501 | |
15f8229b ILT |
502 | // Return the command line argument. |
503 | const Input_file_argument* | |
504 | input_file_argument() const | |
505 | { return this->input_argument_; } | |
506 | ||
507 | // Return whether this is a file that we will search for in the list | |
508 | // of directories. | |
509 | bool | |
510 | will_search_for() const; | |
511 | ||
75f2446e | 512 | // Open the file. If the open fails, this will report an error and |
15f8229b ILT |
513 | // return false. If there is a search, it starts at directory |
514 | // *PINDEX. *PINDEX should be initialized to zero. It may be | |
515 | // restarted to find the next file with a matching name by | |
516 | // incrementing the result and calling this again. | |
75f2446e | 517 | bool |
15f8229b | 518 | open(const Dirsearch&, const Task*, int *pindex); |
bae7f79e | 519 | |
e2aacd2c | 520 | // Return the name given by the user. For -lc this will return "c". |
bae7f79e | 521 | const char* |
14144f39 | 522 | name() const; |
bae7f79e | 523 | |
e2aacd2c ILT |
524 | // Return the file name. For -lc this will return something like |
525 | // "/usr/lib/libc.so". | |
bae7f79e ILT |
526 | const std::string& |
527 | filename() const | |
528 | { return this->file_.filename(); } | |
529 | ||
e2aacd2c ILT |
530 | // Return the name under which we found the file, corresponding to |
531 | // the command line. For -lc this will return something like | |
532 | // "libc.so". | |
533 | const std::string& | |
534 | found_name() const | |
535 | { return this->found_name_; } | |
536 | ||
4973341a ILT |
537 | // Return the position dependent options. |
538 | const Position_dependent_options& | |
14144f39 | 539 | options() const; |
4973341a ILT |
540 | |
541 | // Return the file. | |
bae7f79e ILT |
542 | File_read& |
543 | file() | |
544 | { return this->file_; } | |
545 | ||
7004837e ILT |
546 | const File_read& |
547 | file() const | |
548 | { return this->file_; } | |
549 | ||
ad2d6943 ILT |
550 | // Whether we found the file in a directory in the system root. |
551 | bool | |
552 | is_in_sysroot() const | |
553 | { return this->is_in_sysroot_; } | |
554 | ||
fd9d194f ILT |
555 | // Whether this file is in a system directory. |
556 | bool | |
557 | is_in_system_directory() const; | |
558 | ||
88dd47ac ILT |
559 | // Return whether this file is to be read only for its symbols. |
560 | bool | |
561 | just_symbols() const; | |
562 | ||
10165461 DK |
563 | // Return the format of the unconverted input file. |
564 | Format | |
565 | format() const | |
566 | { return this->format_; } | |
567 | ||
bae7f79e | 568 | private: |
ead1e424 ILT |
569 | Input_file(const Input_file&); |
570 | Input_file& operator=(const Input_file&); | |
571 | ||
bc644c6c ILT |
572 | // Open a binary file. |
573 | bool | |
f1ed28fb | 574 | open_binary(const Task* task, const std::string& name); |
bc644c6c | 575 | |
ad2d6943 | 576 | // The argument from the command line. |
5a6f7e2d | 577 | const Input_file_argument* input_argument_; |
e2aacd2c ILT |
578 | // The name under which we opened the file. This is like the name |
579 | // on the command line, but -lc turns into libc.so (or whatever). | |
580 | // It only includes the full path if the path was on the command | |
581 | // line. | |
582 | std::string found_name_; | |
ad2d6943 | 583 | // The file after we open it. |
bae7f79e | 584 | File_read file_; |
ad2d6943 ILT |
585 | // Whether we found the file in a directory in the system root. |
586 | bool is_in_sysroot_; | |
10165461 DK |
587 | // Format of unconverted input file. |
588 | Format format_; | |
bae7f79e ILT |
589 | }; |
590 | ||
591 | } // end namespace gold | |
592 | ||
593 | #endif // !defined(GOLD_FILEREAD_H) |