Commit | Line | Data |
---|---|---|
3ce2c28e ILT |
1 | // inremental.h -- incremental linking support for gold -*- C++ -*- |
2 | ||
09ec0418 | 3 | // Copyright 2009, 2010 Free Software Foundation, Inc. |
3ce2c28e ILT |
4 | // Written by Mikolaj Zalewski <mikolajz@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 | ||
23 | #ifndef GOLD_INCREMENTAL_H | |
24 | #define GOLD_INCREMENTAL_H | |
25 | ||
072fe7ce | 26 | #include <map> |
3ce2c28e ILT |
27 | #include <vector> |
28 | ||
c549a694 | 29 | #include "elfcpp_file.h" |
3ce2c28e ILT |
30 | #include "stringpool.h" |
31 | #include "workqueue.h" | |
98fa85cb | 32 | #include "fileread.h" |
c549a694 | 33 | #include "output.h" |
3ce2c28e ILT |
34 | |
35 | namespace gold | |
36 | { | |
37 | ||
38 | class Archive; | |
39 | class Input_argument; | |
40 | class Incremental_inputs_checker; | |
09ec0418 CC |
41 | class Incremental_script_entry; |
42 | class Incremental_object_entry; | |
43 | class Incremental_archive_entry; | |
44 | class Incremental_inputs; | |
b961d0d7 | 45 | class Incremental_binary; |
3ce2c28e | 46 | class Object; |
3ce2c28e | 47 | |
072fe7ce ILT |
48 | // Incremental input type as stored in .gnu_incremental_inputs. |
49 | ||
50 | enum Incremental_input_type | |
51 | { | |
072fe7ce | 52 | INCREMENTAL_INPUT_OBJECT = 1, |
09ec0418 CC |
53 | INCREMENTAL_INPUT_ARCHIVE_MEMBER = 2, |
54 | INCREMENTAL_INPUT_ARCHIVE = 3, | |
55 | INCREMENTAL_INPUT_SHARED_LIBRARY = 4, | |
56 | INCREMENTAL_INPUT_SCRIPT = 5 | |
ca55d848 RÁE |
57 | }; |
58 | ||
c549a694 ILT |
59 | // Create an Incremental_binary object for FILE. Returns NULL is this is not |
60 | // possible, e.g. FILE is not an ELF file or has an unsupported target. | |
09ec0418 | 61 | |
c549a694 ILT |
62 | Incremental_binary* |
63 | open_incremental_binary(Output_file* file); | |
64 | ||
44453f85 ILT |
65 | // Code invoked early during an incremental link that checks what files need |
66 | // to be relinked. | |
09ec0418 | 67 | |
44453f85 ILT |
68 | class Incremental_checker |
69 | { | |
70 | public: | |
c4aa1e2d ILT |
71 | // Check if the file named OUTPUT_NAME can be linked incrementally. |
72 | // INCREMENTAL_INPUTS must have the canonical form of the command line | |
73 | // and input arguments filled - at this point of linking other fields are | |
74 | // probably not filled yet. TODO: for inputs that don't need to be | |
75 | // rebuilt, this function should fill the incremental input information. | |
76 | Incremental_checker(const char* output_name, | |
77 | Incremental_inputs* incremental_inputs) | |
78 | : output_name_(output_name), incremental_inputs_(incremental_inputs) | |
44453f85 ILT |
79 | { } |
80 | ||
81 | // Analyzes the output file to check if incremental linking is possible and | |
82 | // what files needs to be relinked. | |
83 | bool | |
84 | can_incrementally_link_output_file(); | |
85 | ||
86 | private: | |
c4aa1e2d | 87 | // Name of the output file to analyze. |
44453f85 | 88 | const char* output_name_; |
c4aa1e2d ILT |
89 | |
90 | // The Incremental_inputs object. At this stage of link, only the command | |
91 | // line and inputs are filled. | |
92 | Incremental_inputs* incremental_inputs_; | |
44453f85 ILT |
93 | }; |
94 | ||
09ec0418 CC |
95 | // Base class for recording each input file. |
96 | ||
97 | class Incremental_input_entry | |
98 | { | |
99 | public: | |
100 | Incremental_input_entry(Stringpool::Key filename_key, Timespec mtime) | |
101 | : filename_key_(filename_key), offset_(0), info_offset_(0), mtime_(mtime) | |
102 | { } | |
103 | ||
b56648ad ILT |
104 | virtual |
105 | ~Incremental_input_entry() | |
106 | { } | |
107 | ||
09ec0418 CC |
108 | // Return the type of input file. |
109 | Incremental_input_type | |
110 | type() const | |
111 | { return this->do_type(); } | |
112 | ||
113 | // Set the section offset of this input file entry. | |
114 | void | |
115 | set_offset(unsigned int offset) | |
116 | { this->offset_ = offset; } | |
117 | ||
118 | // Set the section offset of the supplemental information for this entry. | |
119 | void | |
120 | set_info_offset(unsigned int info_offset) | |
121 | { this->info_offset_ = info_offset; } | |
122 | ||
123 | // Get the section offset of this input file entry. | |
124 | unsigned int | |
125 | get_offset() const | |
126 | { return this->offset_; } | |
127 | ||
128 | // Get the section offset of the supplemental information for this entry. | |
129 | unsigned int | |
130 | get_info_offset() const | |
131 | { return this->info_offset_; } | |
132 | ||
133 | // Get the stringpool key for the input filename. | |
134 | Stringpool::Key | |
135 | get_filename_key() const | |
136 | { return this->filename_key_; } | |
137 | ||
138 | // Get the modification time of the input file. | |
139 | const Timespec& | |
140 | get_mtime() const | |
141 | { return this->mtime_; } | |
142 | ||
143 | // Return a pointer to the derived Incremental_script_entry object. | |
144 | // Return NULL for input entries that are not script files. | |
145 | Incremental_script_entry* | |
146 | script_entry() | |
147 | { return this->do_script_entry(); } | |
148 | ||
149 | // Return a pointer to the derived Incremental_object_entry object. | |
150 | // Return NULL for input entries that are not object files. | |
151 | Incremental_object_entry* | |
152 | object_entry() | |
153 | { return this->do_object_entry(); } | |
154 | ||
155 | // Return a pointer to the derived Incremental_archive_entry object. | |
156 | // Return NULL for input entries that are not archive files. | |
157 | Incremental_archive_entry* | |
158 | archive_entry() | |
159 | { return this->do_archive_entry(); } | |
160 | ||
161 | protected: | |
162 | // Return the type of input file. | |
163 | virtual Incremental_input_type | |
164 | do_type() const = 0; | |
165 | ||
166 | // Return a pointer to the derived Incremental_script_entry object. | |
167 | // Return NULL for input entries that are not script files. | |
168 | virtual Incremental_script_entry* | |
169 | do_script_entry() | |
170 | { return NULL; } | |
171 | ||
172 | // Return a pointer to the derived Incremental_object_entry object. | |
173 | // Return NULL for input entries that are not object files. | |
174 | virtual Incremental_object_entry* | |
175 | do_object_entry() | |
176 | { return NULL; } | |
177 | ||
178 | // Return a pointer to the derived Incremental_archive_entry object. | |
179 | // Return NULL for input entries that are not archive files. | |
180 | virtual Incremental_archive_entry* | |
181 | do_archive_entry() | |
182 | { return NULL; } | |
183 | ||
184 | private: | |
185 | // Key of the filename string in the section stringtable. | |
186 | Stringpool::Key filename_key_; | |
187 | ||
188 | // Offset of the entry in the output section. | |
189 | unsigned int offset_; | |
190 | ||
191 | // Offset of the extra information in the output section. | |
192 | unsigned int info_offset_; | |
193 | ||
194 | // Last modification time of the file. | |
195 | Timespec mtime_; | |
196 | }; | |
197 | ||
198 | // Class for recording input scripts. | |
199 | ||
200 | class Incremental_script_entry : public Incremental_input_entry | |
201 | { | |
202 | public: | |
203 | Incremental_script_entry(Stringpool::Key filename_key, Script_info* script, | |
204 | Timespec mtime) | |
c7975edd | 205 | : Incremental_input_entry(filename_key, mtime), script_(script), objects_() |
09ec0418 CC |
206 | { } |
207 | ||
c7975edd CC |
208 | // Add a member object to the archive. |
209 | void | |
210 | add_object(Incremental_input_entry* obj_entry) | |
211 | { | |
212 | this->objects_.push_back(obj_entry); | |
213 | } | |
214 | ||
215 | // Return the number of objects included by this script. | |
216 | unsigned int | |
217 | get_object_count() | |
218 | { return this->objects_.size(); } | |
219 | ||
220 | // Return the Nth object. | |
221 | Incremental_input_entry* | |
222 | get_object(unsigned int n) | |
223 | { | |
224 | gold_assert(n < this->objects_.size()); | |
225 | return this->objects_[n]; | |
226 | } | |
227 | ||
09ec0418 CC |
228 | protected: |
229 | virtual Incremental_input_type | |
230 | do_type() const | |
231 | { return INCREMENTAL_INPUT_SCRIPT; } | |
232 | ||
233 | // Return a pointer to the derived Incremental_script_entry object. | |
234 | virtual Incremental_script_entry* | |
235 | do_script_entry() | |
236 | { return this; } | |
237 | ||
238 | private: | |
239 | // Information about the script file. | |
240 | Script_info* script_; | |
c7975edd CC |
241 | // Objects that have been included by this script. |
242 | std::vector<Incremental_input_entry*> objects_; | |
09ec0418 CC |
243 | }; |
244 | ||
245 | // Class for recording input object files. | |
246 | ||
247 | class Incremental_object_entry : public Incremental_input_entry | |
248 | { | |
249 | public: | |
250 | Incremental_object_entry(Stringpool::Key filename_key, Object* obj, | |
251 | Timespec mtime) | |
252 | : Incremental_input_entry(filename_key, mtime), obj_(obj), | |
253 | is_member_(false), sections_() | |
254 | { | |
255 | if (!obj_->is_dynamic()) | |
256 | this->sections_.reserve(obj->shnum()); | |
257 | } | |
258 | ||
259 | // Get the object. | |
260 | Object* | |
261 | object() const | |
262 | { return this->obj_; } | |
263 | ||
264 | // Record that this object is an archive member. | |
265 | void | |
266 | set_is_member() | |
267 | { this->is_member_ = true; } | |
268 | ||
269 | // Return true if this object is an archive member. | |
270 | bool | |
271 | is_member() const | |
272 | { return this->is_member_; } | |
273 | ||
274 | // Add an input section. | |
275 | void | |
276 | add_input_section(unsigned int shndx, Stringpool::Key name_key, off_t sh_size) | |
277 | { | |
278 | if (shndx >= this->sections_.size()) | |
279 | this->sections_.resize(shndx + 1); | |
280 | this->sections_[shndx].name_key = name_key; | |
281 | this->sections_[shndx].sh_size = sh_size; | |
282 | } | |
283 | ||
284 | // Return the number of input sections in this object. | |
285 | unsigned int | |
286 | get_input_section_count() const | |
287 | { return this->sections_.size(); } | |
288 | ||
289 | // Return the stringpool key of the Nth input section. | |
290 | Stringpool::Key | |
291 | get_input_section_name_key(unsigned int n) const | |
292 | { return this->sections_[n].name_key; } | |
293 | ||
294 | // Return the size of the Nth input section. | |
295 | off_t | |
296 | get_input_section_size(unsigned int n) const | |
297 | { return this->sections_[n].sh_size; } | |
298 | ||
299 | protected: | |
300 | virtual Incremental_input_type | |
301 | do_type() const | |
302 | { | |
303 | return (this->is_member_ | |
304 | ? INCREMENTAL_INPUT_ARCHIVE_MEMBER | |
305 | : (this->obj_->is_dynamic() | |
306 | ? INCREMENTAL_INPUT_SHARED_LIBRARY | |
307 | : INCREMENTAL_INPUT_OBJECT)); | |
308 | } | |
309 | ||
310 | // Return a pointer to the derived Incremental_object_entry object. | |
311 | virtual Incremental_object_entry* | |
312 | do_object_entry() | |
313 | { return this; } | |
314 | ||
315 | private: | |
316 | // The object file itself. | |
317 | Object* obj_; | |
318 | ||
319 | // Whether this object is an archive member. | |
320 | bool is_member_; | |
321 | ||
322 | // Input sections. | |
323 | struct Input_section | |
324 | { | |
325 | Stringpool::Key name_key; | |
326 | off_t sh_size; | |
327 | }; | |
328 | std::vector<Input_section> sections_; | |
329 | }; | |
330 | ||
331 | // Class for recording archive library input files. | |
332 | ||
333 | class Incremental_archive_entry : public Incremental_input_entry | |
334 | { | |
335 | public: | |
e0c52780 | 336 | Incremental_archive_entry(Stringpool::Key filename_key, Timespec mtime) |
09ec0418 CC |
337 | : Incremental_input_entry(filename_key, mtime), members_(), unused_syms_() |
338 | { } | |
339 | ||
340 | // Add a member object to the archive. | |
341 | void | |
342 | add_object(Incremental_object_entry* obj_entry) | |
343 | { | |
344 | this->members_.push_back(obj_entry); | |
345 | obj_entry->set_is_member(); | |
346 | } | |
347 | ||
348 | // Add an unused global symbol to the archive. | |
349 | void | |
350 | add_unused_global_symbol(Stringpool::Key symbol_key) | |
351 | { this->unused_syms_.push_back(symbol_key); } | |
352 | ||
353 | // Return the number of member objects included in the link. | |
354 | unsigned int | |
355 | get_member_count() | |
356 | { return this->members_.size(); } | |
357 | ||
358 | // Return the Nth member object. | |
359 | Incremental_object_entry* | |
360 | get_member(unsigned int n) | |
361 | { return this->members_[n]; } | |
362 | ||
363 | // Return the number of unused global symbols in this archive. | |
364 | unsigned int | |
365 | get_unused_global_symbol_count() | |
366 | { return this->unused_syms_.size(); } | |
367 | ||
368 | // Return the Nth unused global symbol. | |
369 | Stringpool::Key | |
370 | get_unused_global_symbol(unsigned int n) | |
371 | { return this->unused_syms_[n]; } | |
372 | ||
373 | protected: | |
374 | virtual Incremental_input_type | |
375 | do_type() const | |
376 | { return INCREMENTAL_INPUT_ARCHIVE; } | |
377 | ||
378 | // Return a pointer to the derived Incremental_archive_entry object. | |
379 | virtual Incremental_archive_entry* | |
380 | do_archive_entry() | |
381 | { return this; } | |
382 | ||
383 | private: | |
384 | // Members of the archive that have been included in the link. | |
385 | std::vector<Incremental_object_entry*> members_; | |
386 | ||
387 | // Unused global symbols from this archive. | |
388 | std::vector<Stringpool::Key> unused_syms_; | |
389 | }; | |
390 | ||
3ce2c28e ILT |
391 | // This class contains the information needed during an incremental |
392 | // build about the inputs necessary to build the .gnu_incremental_inputs. | |
09ec0418 | 393 | |
3ce2c28e ILT |
394 | class Incremental_inputs |
395 | { | |
396 | public: | |
09ec0418 CC |
397 | typedef std::vector<Incremental_input_entry*> Input_list; |
398 | ||
3ce2c28e | 399 | Incremental_inputs() |
09ec0418 CC |
400 | : inputs_(), command_line_(), command_line_key_(0), |
401 | strtab_(new Stringpool()), current_object_(NULL), | |
402 | current_object_entry_(NULL), inputs_section_(NULL), | |
403 | symtab_section_(NULL), relocs_section_(NULL), | |
404 | reloc_count_(0) | |
3ce2c28e | 405 | { } |
09ec0418 | 406 | |
3ce2c28e ILT |
407 | ~Incremental_inputs() { delete this->strtab_; } |
408 | ||
409 | // Record the command line. | |
410 | void | |
411 | report_command_line(int argc, const char* const* argv); | |
072fe7ce | 412 | |
09ec0418 CC |
413 | // Record the initial info for archive file ARCHIVE. |
414 | void | |
c7975edd | 415 | report_archive_begin(Library_base* arch, Script_info* script_info); |
09ec0418 CC |
416 | |
417 | // Record the final info for archive file ARCHIVE. | |
418 | void | |
e0c52780 | 419 | report_archive_end(Library_base* arch); |
09ec0418 CC |
420 | |
421 | // Record the info for object file OBJ. If ARCH is not NULL, | |
422 | // attach the object file to the archive. | |
072fe7ce | 423 | void |
c7975edd | 424 | report_object(Object* obj, Library_base* arch, Script_info* script_info); |
072fe7ce | 425 | |
09ec0418 | 426 | // Record an input section belonging to object file OBJ. |
072fe7ce | 427 | void |
09ec0418 CC |
428 | report_input_section(Object* obj, unsigned int shndx, const char* name, |
429 | off_t sh_size); | |
072fe7ce | 430 | |
09ec0418 | 431 | // Record the info for input script SCRIPT. |
072fe7ce | 432 | void |
09ec0418 CC |
433 | report_script(const std::string& filename, Script_info* script, |
434 | Timespec mtime); | |
435 | ||
436 | // Return the running count of incremental relocations. | |
437 | unsigned int | |
438 | get_reloc_count() const | |
439 | { return this->reloc_count_; } | |
072fe7ce | 440 | |
09ec0418 | 441 | // Update the running count of incremental relocations. |
072fe7ce | 442 | void |
09ec0418 CC |
443 | set_reloc_count(unsigned int count) |
444 | { this->reloc_count_ = count; } | |
072fe7ce | 445 | |
3ce2c28e ILT |
446 | // Prepare for layout. Called from Layout::finalize. |
447 | void | |
448 | finalize(); | |
449 | ||
09ec0418 CC |
450 | // Create the .gnu_incremental_inputs and related sections. |
451 | void | |
452 | create_data_sections(Symbol_table* symtab); | |
453 | ||
454 | // Return the .gnu_incremental_inputs section. | |
3ce2c28e | 455 | Output_section_data* |
09ec0418 CC |
456 | inputs_section() const |
457 | { return this->inputs_section_; } | |
458 | ||
459 | // Return the .gnu_incremental_symtab section. | |
460 | Output_data_space* | |
461 | symtab_section() const | |
462 | { return this->symtab_section_; } | |
463 | ||
464 | // Return the .gnu_incremental_relocs section. | |
465 | Output_data_space* | |
466 | relocs_section() const | |
467 | { return this->relocs_section_; } | |
072fe7ce | 468 | |
0e70b911 CC |
469 | // Return the .gnu_incremental_got_plt section. |
470 | Output_data_space* | |
471 | got_plt_section() const | |
472 | { return this->got_plt_section_; } | |
473 | ||
072fe7ce | 474 | // Return the .gnu_incremental_strtab stringpool. |
3ce2c28e | 475 | Stringpool* |
09ec0418 | 476 | get_stringpool() const |
3ce2c28e ILT |
477 | { return this->strtab_; } |
478 | ||
c4aa1e2d ILT |
479 | // Return the canonical form of the command line, as will be stored in |
480 | // .gnu_incremental_strtab. | |
481 | const std::string& | |
09ec0418 | 482 | command_line() const |
c4aa1e2d ILT |
483 | { return this->command_line_; } |
484 | ||
09ec0418 CC |
485 | // Return the stringpool key of the command line. |
486 | Stringpool::Key | |
487 | command_line_key() const | |
488 | { return this->command_line_key_; } | |
489 | ||
490 | // Return the number of input files. | |
491 | int | |
492 | input_file_count() const | |
493 | { return this->inputs_.size(); } | |
494 | ||
495 | // Return the input files. | |
496 | const Input_list& | |
497 | input_files() const | |
c4aa1e2d ILT |
498 | { return this->inputs_; } |
499 | ||
09ec0418 CC |
500 | // Return the sh_entsize value for the .gnu_incremental_relocs section. |
501 | unsigned int | |
502 | relocs_entsize() const; | |
503 | ||
3ce2c28e | 504 | private: |
09ec0418 CC |
505 | // The list of input files. |
506 | Input_list inputs_; | |
072fe7ce | 507 | |
09ec0418 CC |
508 | // Canonical form of the command line, as will be stored in |
509 | // .gnu_incremental_strtab. | |
510 | std::string command_line_; | |
072fe7ce | 511 | |
09ec0418 CC |
512 | // The key of the command line string in the string pool. |
513 | Stringpool::Key command_line_key_; | |
514 | ||
515 | // The .gnu_incremental_strtab string pool associated with the | |
516 | // .gnu_incremental_inputs. | |
517 | Stringpool* strtab_; | |
518 | ||
519 | // Keep track of the object currently being processed. | |
520 | Object* current_object_; | |
521 | Incremental_object_entry* current_object_entry_; | |
522 | ||
523 | // The .gnu_incremental_inputs section. | |
524 | Output_section_data* inputs_section_; | |
072fe7ce | 525 | |
09ec0418 CC |
526 | // The .gnu_incremental_symtab section. |
527 | Output_data_space* symtab_section_; | |
528 | ||
529 | // The .gnu_incremental_relocs section. | |
530 | Output_data_space* relocs_section_; | |
531 | ||
0e70b911 CC |
532 | // The .gnu_incremental_got_plt section. |
533 | Output_data_space* got_plt_section_; | |
534 | ||
09ec0418 CC |
535 | // Total count of incremental relocations. Updated during Scan_relocs |
536 | // phase at the completion of each object file. | |
537 | unsigned int reloc_count_; | |
538 | }; | |
539 | ||
540 | // Reader class for .gnu_incremental_inputs section. | |
541 | ||
542 | template<int size, bool big_endian> | |
543 | class Incremental_inputs_reader | |
544 | { | |
545 | private: | |
546 | typedef elfcpp::Swap<size, big_endian> Swap; | |
547 | typedef elfcpp::Swap<16, big_endian> Swap16; | |
548 | typedef elfcpp::Swap<32, big_endian> Swap32; | |
549 | typedef elfcpp::Swap<64, big_endian> Swap64; | |
550 | ||
551 | public: | |
b961d0d7 CC |
552 | Incremental_inputs_reader() |
553 | : p_(NULL), strtab_(NULL, 0), input_file_count_(0) | |
554 | { } | |
555 | ||
556 | Incremental_inputs_reader(const unsigned char* p, | |
557 | const elfcpp::Elf_strtab& strtab) | |
09ec0418 CC |
558 | : p_(p), strtab_(strtab) |
559 | { this->input_file_count_ = Swap32::readval(this->p_ + 4); } | |
560 | ||
561 | // Return the version number. | |
562 | unsigned int | |
563 | version() const | |
564 | { return Swap32::readval(this->p_); } | |
565 | ||
566 | // Return the count of input file entries. | |
567 | unsigned int | |
568 | input_file_count() const | |
569 | { return this->input_file_count_; } | |
570 | ||
571 | // Return the command line. | |
572 | const char* | |
573 | command_line() const | |
072fe7ce | 574 | { |
09ec0418 CC |
575 | unsigned int offset = Swap32::readval(this->p_ + 8); |
576 | return this->get_string(offset); | |
577 | } | |
072fe7ce | 578 | |
09ec0418 CC |
579 | // Reader class for an input file entry and its supplemental info. |
580 | class Incremental_input_entry_reader | |
581 | { | |
582 | public: | |
583 | Incremental_input_entry_reader(const Incremental_inputs_reader* inputs, | |
584 | unsigned int offset) | |
585 | : inputs_(inputs), offset_(offset) | |
586 | { | |
587 | this->info_offset_ = Swap32::readval(inputs->p_ + offset + 4); | |
588 | int type = Swap16::readval(this->inputs_->p_ + offset + 20); | |
589 | this->type_ = static_cast<Incremental_input_type>(type); | |
590 | } | |
591 | ||
592 | // Return the filename. | |
593 | const char* | |
594 | filename() const | |
595 | { | |
596 | unsigned int offset = Swap32::readval(this->inputs_->p_ + this->offset_); | |
597 | return this->inputs_->get_string(offset); | |
598 | } | |
072fe7ce | 599 | |
09ec0418 CC |
600 | // Return the timestamp. |
601 | Timespec | |
602 | get_mtime() const | |
603 | { | |
604 | Timespec t; | |
605 | const unsigned char* p = this->inputs_->p_ + this->offset_ + 8; | |
606 | t.seconds = Swap64::readval(p); | |
607 | t.nanoseconds = Swap32::readval(p+8); | |
608 | return t; | |
609 | } | |
610 | ||
611 | // Return the type of input file. | |
612 | Incremental_input_type | |
613 | type() const | |
614 | { return this->type_; } | |
615 | ||
616 | // Return the input section count -- for objects only. | |
617 | unsigned int | |
618 | get_input_section_count() const | |
98fa85cb | 619 | { |
09ec0418 CC |
620 | gold_assert(this->type_ == INCREMENTAL_INPUT_OBJECT |
621 | || this->type_ == INCREMENTAL_INPUT_ARCHIVE_MEMBER); | |
622 | return Swap32::readval(this->inputs_->p_ + this->info_offset_); | |
623 | } | |
624 | ||
625 | // Return the offset of the supplemental info for symbol SYMNDX -- | |
626 | // for objects only. | |
627 | unsigned int | |
628 | get_symbol_offset(unsigned int symndx) const | |
629 | { | |
630 | gold_assert(this->type_ == INCREMENTAL_INPUT_OBJECT | |
631 | || this->type_ == INCREMENTAL_INPUT_ARCHIVE_MEMBER); | |
632 | ||
633 | unsigned int section_count = this->get_input_section_count(); | |
634 | return (this->info_offset_ + 8 | |
635 | + section_count * input_section_entry_size | |
636 | + symndx * 16); | |
637 | } | |
638 | ||
639 | // Return the global symbol count -- for objects & shared libraries only. | |
640 | unsigned int | |
641 | get_global_symbol_count() const | |
642 | { | |
643 | switch (this->type_) | |
644 | { | |
645 | case INCREMENTAL_INPUT_OBJECT: | |
646 | case INCREMENTAL_INPUT_ARCHIVE_MEMBER: | |
647 | return Swap32::readval(this->inputs_->p_ + this->info_offset_ + 4); | |
648 | case INCREMENTAL_INPUT_SHARED_LIBRARY: | |
649 | return Swap32::readval(this->inputs_->p_ + this->info_offset_); | |
650 | default: | |
651 | gold_unreachable(); | |
652 | } | |
653 | } | |
654 | ||
c7975edd CC |
655 | // Return the object count -- for scripts only. |
656 | unsigned int | |
657 | get_object_count() const | |
658 | { | |
659 | gold_assert(this->type_ == INCREMENTAL_INPUT_SCRIPT); | |
660 | return Swap32::readval(this->inputs_->p_ + this->info_offset_); | |
661 | } | |
662 | ||
663 | // Return the input file offset for object N -- for scripts only. | |
664 | unsigned int | |
665 | get_object_offset(unsigned int n) const | |
666 | { | |
667 | gold_assert(this->type_ == INCREMENTAL_INPUT_SCRIPT); | |
668 | return Swap32::readval(this->inputs_->p_ + this->info_offset_ | |
669 | + 4 + n * 4); | |
670 | } | |
671 | ||
09ec0418 CC |
672 | // Return the member count -- for archives only. |
673 | unsigned int | |
674 | get_member_count() const | |
675 | { | |
676 | gold_assert(this->type_ == INCREMENTAL_INPUT_ARCHIVE); | |
677 | return Swap32::readval(this->inputs_->p_ + this->info_offset_); | |
678 | } | |
44453f85 | 679 | |
09ec0418 CC |
680 | // Return the unused symbol count -- for archives only. |
681 | unsigned int | |
682 | get_unused_symbol_count() const | |
683 | { | |
684 | gold_assert(this->type_ == INCREMENTAL_INPUT_ARCHIVE); | |
685 | return Swap32::readval(this->inputs_->p_ + this->info_offset_ + 4); | |
686 | } | |
44453f85 | 687 | |
09ec0418 CC |
688 | // Return the input file offset for archive member N -- for archives only. |
689 | unsigned int | |
690 | get_member_offset(unsigned int n) const | |
691 | { | |
692 | gold_assert(this->type_ == INCREMENTAL_INPUT_ARCHIVE); | |
693 | return Swap32::readval(this->inputs_->p_ + this->info_offset_ | |
694 | + 8 + n * 4); | |
695 | } | |
696 | ||
697 | // Return the Nth unused global symbol -- for archives only. | |
698 | const char* | |
699 | get_unused_symbol(unsigned int n) const | |
700 | { | |
701 | gold_assert(this->type_ == INCREMENTAL_INPUT_ARCHIVE); | |
702 | unsigned int member_count = this->get_member_count(); | |
703 | unsigned int offset = Swap32::readval(this->inputs_->p_ | |
704 | + this->info_offset_ + 8 | |
705 | + member_count * 4 | |
706 | + n * 4); | |
707 | return this->inputs_->get_string(offset); | |
708 | } | |
709 | ||
710 | // Information about an input section. | |
711 | struct Input_section_info | |
712 | { | |
713 | const char* name; | |
714 | unsigned int output_shndx; | |
715 | off_t sh_offset; | |
716 | off_t sh_size; | |
98fa85cb | 717 | }; |
072fe7ce | 718 | |
09ec0418 CC |
719 | // Return info about the Nth input section -- for objects only. |
720 | Input_section_info | |
721 | get_input_section(unsigned int n) const | |
722 | { | |
723 | Input_section_info info; | |
724 | const unsigned char* p = (this->inputs_->p_ | |
725 | + this->info_offset_ + 8 | |
726 | + n * input_section_entry_size); | |
727 | unsigned int name_offset = Swap32::readval(p); | |
728 | info.name = this->inputs_->get_string(name_offset); | |
729 | info.output_shndx = Swap32::readval(p + 4); | |
730 | info.sh_offset = Swap::readval(p + 8); | |
731 | info.sh_size = Swap::readval(p + 8 + size / 8); | |
732 | return info; | |
733 | } | |
734 | ||
735 | // Information about a global symbol. | |
736 | struct Global_symbol_info | |
737 | { | |
738 | unsigned int output_symndx; | |
739 | unsigned int next_offset; | |
740 | unsigned int reloc_count; | |
741 | unsigned int reloc_offset; | |
742 | }; | |
072fe7ce | 743 | |
09ec0418 CC |
744 | // Return info about the Nth global symbol -- for objects only. |
745 | Global_symbol_info | |
746 | get_global_symbol_info(unsigned int n) const | |
747 | { | |
748 | Global_symbol_info info; | |
749 | unsigned int section_count = this->get_input_section_count(); | |
750 | const unsigned char* p = (this->inputs_->p_ | |
751 | + this->info_offset_ + 8 | |
752 | + section_count * input_section_entry_size | |
753 | + n * 16); | |
754 | info.output_symndx = Swap32::readval(p); | |
755 | info.next_offset = Swap32::readval(p + 4); | |
756 | info.reloc_count = Swap::readval(p + 8); | |
757 | info.reloc_offset = Swap::readval(p + 12); | |
758 | return info; | |
759 | } | |
44453f85 | 760 | |
09ec0418 CC |
761 | private: |
762 | // Size of an input section entry. | |
763 | static const unsigned int input_section_entry_size = 8 + 2 * size / 8; | |
764 | // The reader instance for the containing section. | |
765 | const Incremental_inputs_reader* inputs_; | |
766 | // The type of input file. | |
767 | Incremental_input_type type_; | |
768 | // Section offset to the input file entry. | |
769 | unsigned int offset_; | |
770 | // Section offset to the supplemental info for the input file. | |
771 | unsigned int info_offset_; | |
072fe7ce ILT |
772 | }; |
773 | ||
09ec0418 CC |
774 | // Return a reader for the Nth input file entry. |
775 | Incremental_input_entry_reader | |
776 | input_file(unsigned int n) const | |
777 | { | |
778 | gold_assert(n < this->input_file_count_); | |
779 | Incremental_input_entry_reader input(this, 16 + n * 24); | |
780 | return input; | |
781 | } | |
782 | ||
783 | private: | |
784 | // Lookup a string in the ELF string table. | |
785 | const char* get_string(unsigned int offset) const | |
786 | { | |
787 | const char* s; | |
788 | if (this->strtab_.get_c_string(offset, &s)) | |
789 | return s; | |
790 | return NULL; | |
791 | } | |
792 | ||
793 | // Base address of the .gnu_incremental_inputs section. | |
794 | const unsigned char* p_; | |
795 | // The associated ELF string table. | |
796 | elfcpp::Elf_strtab strtab_; | |
797 | // The number of input file entries in this section. | |
798 | unsigned int input_file_count_; | |
799 | }; | |
800 | ||
801 | // Reader class for the .gnu_incremental_symtab section. | |
072fe7ce | 802 | |
09ec0418 CC |
803 | template<bool big_endian> |
804 | class Incremental_symtab_reader | |
805 | { | |
806 | public: | |
b961d0d7 CC |
807 | Incremental_symtab_reader() |
808 | : p_(NULL), len_(0) | |
809 | { } | |
810 | ||
811 | Incremental_symtab_reader(const unsigned char* p, off_t len) | |
812 | : p_(p), len_(len) | |
09ec0418 | 813 | { } |
44453f85 | 814 | |
b961d0d7 CC |
815 | // Return the count of symbols in this section. |
816 | unsigned int | |
817 | symbol_count() const | |
818 | { return static_cast<unsigned int>(this->len_ / 4); } | |
819 | ||
09ec0418 | 820 | // Return the list head for symbol table entry N. |
b961d0d7 CC |
821 | unsigned int |
822 | get_list_head(unsigned int n) const | |
09ec0418 | 823 | { return elfcpp::Swap<32, big_endian>::readval(this->p_ + 4 * n); } |
072fe7ce | 824 | |
09ec0418 CC |
825 | private: |
826 | // Base address of the .gnu_incremental_relocs section. | |
827 | const unsigned char* p_; | |
b961d0d7 CC |
828 | // Size of the section. |
829 | off_t len_; | |
09ec0418 | 830 | }; |
3ce2c28e | 831 | |
09ec0418 | 832 | // Reader class for the .gnu_incremental_relocs section. |
c4aa1e2d | 833 | |
09ec0418 CC |
834 | template<int size, bool big_endian> |
835 | class Incremental_relocs_reader | |
836 | { | |
837 | private: | |
838 | // Size of each field. | |
839 | static const unsigned int field_size = size / 8; | |
c4aa1e2d | 840 | |
09ec0418 CC |
841 | public: |
842 | typedef typename elfcpp::Elf_types<size>::Elf_Addr Address; | |
843 | typedef typename elfcpp::Elf_types<size>::Elf_Swxword Addend; | |
844 | ||
845 | // Size of each entry. | |
846 | static const unsigned int reloc_size = 8 + 2 * field_size; | |
847 | ||
b961d0d7 CC |
848 | Incremental_relocs_reader() |
849 | : p_(NULL), len_(0) | |
850 | { } | |
851 | ||
852 | Incremental_relocs_reader(const unsigned char* p, off_t len) | |
853 | : p_(p), len_(len) | |
09ec0418 CC |
854 | { } |
855 | ||
b961d0d7 CC |
856 | // Return the count of relocations in this section. |
857 | unsigned int | |
858 | reloc_count() const | |
859 | { return static_cast<unsigned int>(this->len_ / reloc_size); } | |
860 | ||
09ec0418 CC |
861 | // Return the relocation type for relocation entry at offset OFF. |
862 | unsigned int | |
0e70b911 | 863 | get_r_type(unsigned int off) const |
09ec0418 CC |
864 | { |
865 | return elfcpp::Swap<32, big_endian>::readval(this->p_ + off); | |
866 | } | |
867 | ||
868 | // Return the output section index for relocation entry at offset OFF. | |
869 | unsigned int | |
0e70b911 | 870 | get_r_shndx(unsigned int off) const |
09ec0418 CC |
871 | { |
872 | return elfcpp::Swap<32, big_endian>::readval(this->p_ + off + 4); | |
873 | } | |
874 | ||
875 | // Return the output section offset for relocation entry at offset OFF. | |
876 | Address | |
0e70b911 | 877 | get_r_offset(unsigned int off) const |
09ec0418 CC |
878 | { |
879 | return elfcpp::Swap<size, big_endian>::readval(this->p_ + off + 8); | |
880 | } | |
881 | ||
882 | // Return the addend for relocation entry at offset OFF. | |
883 | Addend | |
0e70b911 | 884 | get_r_addend(unsigned int off) const |
09ec0418 CC |
885 | { |
886 | return elfcpp::Swap<size, big_endian>::readval(this->p_ + off + 8 | |
887 | + this->field_size); | |
888 | } | |
889 | ||
890 | private: | |
891 | // Base address of the .gnu_incremental_relocs section. | |
892 | const unsigned char* p_; | |
b961d0d7 CC |
893 | // Size of the section. |
894 | off_t len_; | |
3ce2c28e ILT |
895 | }; |
896 | ||
0e70b911 CC |
897 | // Reader class for the .gnu_incremental_got_plt section. |
898 | ||
899 | template<bool big_endian> | |
900 | class Incremental_got_plt_reader | |
901 | { | |
902 | public: | |
b961d0d7 CC |
903 | Incremental_got_plt_reader() |
904 | : p_(NULL), got_count_(0), got_desc_p_(NULL), plt_desc_p_(NULL) | |
905 | { } | |
906 | ||
0e70b911 CC |
907 | Incremental_got_plt_reader(const unsigned char* p) : p_(p) |
908 | { | |
909 | this->got_count_ = elfcpp::Swap<32, big_endian>::readval(p); | |
910 | this->got_desc_p_ = p + 8 + ((this->got_count_ + 3) & ~3); | |
911 | this->plt_desc_p_ = this->got_desc_p_ + this->got_count_ * 4; | |
912 | } | |
913 | ||
914 | // Return the GOT entry count. | |
915 | unsigned int | |
916 | get_got_entry_count() const | |
917 | { | |
918 | return this->got_count_; | |
919 | } | |
920 | ||
921 | // Return the PLT entry count. | |
922 | unsigned int | |
923 | get_plt_entry_count() const | |
924 | { | |
925 | return elfcpp::Swap<32, big_endian>::readval(this->p_ + 4); | |
926 | } | |
927 | ||
928 | // Return the GOT type for GOT entry N. | |
929 | unsigned int | |
930 | get_got_type(unsigned int n) | |
931 | { | |
932 | return this->p_[8 + n]; | |
933 | } | |
934 | ||
935 | // Return the GOT descriptor for GOT entry N. | |
936 | unsigned int | |
937 | get_got_desc(unsigned int n) | |
938 | { | |
939 | return elfcpp::Swap<32, big_endian>::readval(this->got_desc_p_ + n * 4); | |
940 | } | |
941 | ||
942 | // Return the PLT descriptor for PLT entry N. | |
943 | unsigned int | |
944 | get_plt_desc(unsigned int n) | |
945 | { | |
946 | return elfcpp::Swap<32, big_endian>::readval(this->plt_desc_p_ + n * 4); | |
947 | } | |
948 | ||
949 | private: | |
950 | // Base address of the .gnu_incremental_got_plt section. | |
951 | const unsigned char* p_; | |
952 | // GOT entry count. | |
953 | unsigned int got_count_; | |
954 | // Base address of the GOT descriptor array. | |
955 | const unsigned char* got_desc_p_; | |
956 | // Base address of the PLT descriptor array. | |
957 | const unsigned char* plt_desc_p_; | |
958 | }; | |
959 | ||
b961d0d7 CC |
960 | // An object representing the ELF file we edit during an incremental build. |
961 | // Similar to Object or Dynobj, but operates on Output_file and contains | |
962 | // methods to support incremental updating. This is the abstract parent class | |
963 | // implemented in Sized_incremental_binary<size, big_endian> for a specific | |
964 | // endianness and size. | |
965 | ||
966 | class Incremental_binary | |
967 | { | |
968 | public: | |
969 | Incremental_binary(Output_file* output, Target* target) | |
970 | : output_(output), target_(target) | |
971 | { } | |
972 | ||
973 | virtual | |
974 | ~Incremental_binary() | |
975 | { } | |
976 | ||
977 | // Check the .gnu_incremental_inputs section to see whether an incremental | |
978 | // build is possible. | |
979 | bool | |
980 | check_inputs(Incremental_inputs* incremental_inputs) | |
981 | { return this->do_check_inputs(incremental_inputs); } | |
982 | ||
983 | // Return TRUE if the file specified by INPUT_ARGUMENT is unchanged | |
984 | // with respect to the base file. | |
985 | bool | |
986 | file_is_unchanged(const Input_argument* input_argument) const | |
987 | { return this->do_file_is_unchanged(input_argument); } | |
988 | ||
989 | // Report an error. | |
990 | void | |
991 | error(const char* format, ...) const ATTRIBUTE_PRINTF_2; | |
992 | ||
993 | // Wrapper class for a sized Incremental_input_entry_reader. | |
994 | ||
995 | class Input_reader | |
996 | { | |
997 | public: | |
998 | Input_reader() | |
999 | { } | |
1000 | ||
1001 | virtual | |
1002 | ~Input_reader() | |
1003 | { } | |
1004 | ||
1005 | const char* | |
1006 | filename() const | |
1007 | { return this->do_filename(); } | |
1008 | ||
1009 | Timespec | |
1010 | get_mtime() const | |
1011 | { return this->do_get_mtime(); } | |
1012 | ||
1013 | Incremental_input_type | |
1014 | type() const | |
1015 | { return this->do_type(); } | |
1016 | ||
1017 | protected: | |
1018 | virtual const char* | |
1019 | do_filename() const = 0; | |
1020 | ||
1021 | virtual Timespec | |
1022 | do_get_mtime() const = 0; | |
1023 | ||
1024 | virtual Incremental_input_type | |
1025 | do_type() const = 0; | |
1026 | }; | |
1027 | ||
1028 | Input_reader* | |
1029 | get_input_reader(const char* filename) | |
1030 | { return this->do_get_input_reader(filename); } | |
1031 | ||
1032 | // Functions and types for the elfcpp::Elf_file interface. This | |
1033 | // permit us to use Incremental_binary as the File template parameter for | |
1034 | // elfcpp::Elf_file. | |
1035 | ||
1036 | // The View class is returned by view. It must support a single | |
1037 | // method, data(). This is trivial, because Output_file::get_output_view | |
1038 | // does what we need. | |
1039 | class View | |
1040 | { | |
1041 | public: | |
1042 | View(const unsigned char* p) | |
1043 | : p_(p) | |
1044 | { } | |
1045 | ||
1046 | const unsigned char* | |
1047 | data() const | |
1048 | { return this->p_; } | |
1049 | ||
1050 | private: | |
1051 | const unsigned char* p_; | |
1052 | }; | |
1053 | ||
1054 | // Return a View. | |
1055 | View | |
1056 | view(off_t file_offset, section_size_type data_size) | |
1057 | { return View(this->output_->get_input_view(file_offset, data_size)); } | |
1058 | ||
1059 | // A location in the file. | |
1060 | struct Location | |
1061 | { | |
1062 | off_t file_offset; | |
1063 | off_t data_size; | |
1064 | ||
1065 | Location(off_t fo, section_size_type ds) | |
1066 | : file_offset(fo), data_size(ds) | |
1067 | { } | |
1068 | ||
1069 | Location() | |
1070 | : file_offset(0), data_size(0) | |
1071 | { } | |
1072 | }; | |
1073 | ||
1074 | // Get a View given a Location. | |
1075 | View | |
1076 | view(Location loc) | |
1077 | { return View(this->view(loc.file_offset, loc.data_size)); } | |
1078 | ||
1079 | protected: | |
1080 | // Check the .gnu_incremental_inputs section to see whether an incremental | |
1081 | // build is possible. | |
1082 | virtual bool | |
1083 | do_check_inputs(Incremental_inputs* incremental_inputs) = 0; | |
1084 | ||
1085 | // Return TRUE if the file specified by INPUT_ARGUMENT is unchanged | |
1086 | // with respect to the base file. | |
1087 | virtual bool | |
1088 | do_file_is_unchanged(const Input_argument* input_argument) const = 0; | |
1089 | ||
1090 | virtual Input_reader* | |
1091 | do_get_input_reader(const char* filename) = 0; | |
1092 | ||
1093 | private: | |
1094 | // Edited output file object. | |
1095 | Output_file* output_; | |
1096 | // Target of the output file. | |
1097 | Target* target_; | |
1098 | }; | |
1099 | ||
1100 | template<int size, bool big_endian> | |
1101 | class Sized_incremental_binary : public Incremental_binary | |
1102 | { | |
1103 | public: | |
1104 | Sized_incremental_binary(Output_file* output, | |
1105 | const elfcpp::Ehdr<size, big_endian>& ehdr, | |
1106 | Target* target) | |
1107 | : Incremental_binary(output, target), elf_file_(this, ehdr), | |
1108 | has_incremental_info_(false), inputs_reader_(), symtab_reader_(), | |
1109 | relocs_reader_(), got_plt_reader_(), current_input_file_(0) | |
1110 | { this->setup_readers(); } | |
1111 | ||
1112 | // Returns TRUE if the file contains incremental info. | |
1113 | bool | |
1114 | has_incremental_info() const | |
1115 | { return this->has_incremental_info_; } | |
1116 | ||
1117 | // Readers for the incremental info sections. | |
1118 | ||
1119 | Incremental_inputs_reader<size, big_endian> | |
1120 | inputs_reader() const | |
1121 | { return this->inputs_reader_; } | |
1122 | ||
1123 | Incremental_symtab_reader<big_endian> | |
1124 | symtab_reader() const | |
1125 | { return this->symtab_reader_; } | |
1126 | ||
1127 | Incremental_relocs_reader<size, big_endian> | |
1128 | relocs_reader() const | |
1129 | { return this->relocs_reader_; } | |
1130 | ||
1131 | Incremental_got_plt_reader<big_endian> | |
1132 | got_plt_reader() const | |
1133 | { return this->got_plt_reader_; } | |
1134 | ||
1135 | protected: | |
1136 | virtual bool | |
1137 | do_check_inputs(Incremental_inputs* incremental_inputs); | |
1138 | ||
1139 | // Return TRUE if the file specified by INPUT_ARGUMENT is unchanged | |
1140 | // with respect to the base file. | |
1141 | virtual bool | |
1142 | do_file_is_unchanged(const Input_argument* input_argument) const; | |
1143 | ||
1144 | // Wrapper class for a sized Incremental_input_entry_reader. | |
1145 | ||
1146 | class Sized_input_reader : public Input_reader | |
1147 | { | |
1148 | public: | |
1149 | typedef Incremental_inputs_reader<size, big_endian> Inputs_reader; | |
1150 | typedef typename Inputs_reader::Incremental_input_entry_reader | |
1151 | Input_entry_reader; | |
1152 | ||
1153 | Sized_input_reader(Input_entry_reader r) | |
1154 | : Input_reader(), reader_(r) | |
1155 | { } | |
1156 | ||
1157 | virtual | |
1158 | ~Sized_input_reader() | |
1159 | { } | |
1160 | ||
1161 | private: | |
1162 | const char* | |
1163 | do_filename() const | |
1164 | { return this->reader_.filename(); } | |
1165 | ||
1166 | Timespec | |
1167 | do_get_mtime() const | |
1168 | { return this->reader_.get_mtime(); } | |
1169 | ||
1170 | Incremental_input_type | |
1171 | do_type() const | |
1172 | { return this->reader_.type(); } | |
1173 | ||
1174 | Input_entry_reader reader_; | |
1175 | }; | |
1176 | ||
1177 | virtual Input_reader* | |
1178 | do_get_input_reader(const char* filename); | |
1179 | ||
1180 | private: | |
1181 | bool | |
1182 | find_incremental_inputs_sections(unsigned int* p_inputs_shndx, | |
1183 | unsigned int* p_symtab_shndx, | |
1184 | unsigned int* p_relocs_shndx, | |
1185 | unsigned int* p_got_plt_shndx, | |
1186 | unsigned int* p_strtab_shndx); | |
1187 | ||
1188 | void | |
1189 | setup_readers(); | |
1190 | ||
1191 | // Output as an ELF file. | |
1192 | elfcpp::Elf_file<size, big_endian, Incremental_binary> elf_file_; | |
1193 | ||
1194 | // Readers for the incremental info sections. | |
1195 | bool has_incremental_info_; | |
1196 | Incremental_inputs_reader<size, big_endian> inputs_reader_; | |
1197 | Incremental_symtab_reader<big_endian> symtab_reader_; | |
1198 | Incremental_relocs_reader<size, big_endian> relocs_reader_; | |
1199 | Incremental_got_plt_reader<big_endian> got_plt_reader_; | |
1200 | ||
1201 | // Index of the current input file entry. | |
1202 | int current_input_file_; | |
1203 | }; | |
1204 | ||
3ce2c28e ILT |
1205 | } // End namespace gold. |
1206 | ||
1207 | #endif // !defined(GOLD_INCREMENTAL_H) |