1 // inremental.h -- incremental linking support for gold -*- C++ -*-
3 // Copyright 2009, 2010 Free Software Foundation, Inc.
4 // Written by Mikolaj Zalewski <mikolajz@google.com>.
6 // This file is part of gold.
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.
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.
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.
23 #ifndef GOLD_INCREMENTAL_H
24 #define GOLD_INCREMENTAL_H
29 #include "elfcpp_file.h"
30 #include "stringpool.h"
31 #include "workqueue.h"
40 class Incremental_inputs_checker
;
41 class Incremental_script_entry
;
42 class Incremental_object_entry
;
43 class Incremental_archive_entry
;
44 class Incremental_inputs
;
47 // Incremental input type as stored in .gnu_incremental_inputs.
49 enum Incremental_input_type
51 INCREMENTAL_INPUT_OBJECT
= 1,
52 INCREMENTAL_INPUT_ARCHIVE_MEMBER
= 2,
53 INCREMENTAL_INPUT_ARCHIVE
= 3,
54 INCREMENTAL_INPUT_SHARED_LIBRARY
= 4,
55 INCREMENTAL_INPUT_SCRIPT
= 5
58 // An object representing the ELF file we edit during an incremental build.
59 // Similar to Object or Dynobj, but operates on Output_file and contains
60 // method specific to file edition (TBD). This is the abstract parent class
61 // implemented in Sized_incremental_binary<size, big_endian> for a specific
62 // endianness and size.
64 class Incremental_binary
67 Incremental_binary(Output_file
* output
, Target
* target
)
68 : output_(output
), target_(target
)
75 // Functions and types for the elfcpp::Elf_file interface. This
76 // permit us to use Incremental_binary as the File template parameter for
79 // The View class is returned by view. It must support a single
80 // method, data(). This is trivial, because Output_file::get_output_view
85 View(const unsigned char* p
)
94 const unsigned char* p_
;
99 view(off_t file_offset
, section_size_type data_size
)
100 { return View(this->output_
->get_input_view(file_offset
, data_size
)); }
102 // A location in the file.
108 Location(off_t fo
, section_size_type ds
)
109 : file_offset(fo
), data_size(ds
)
113 : file_offset(0), data_size(0)
117 // Get a View given a Location.
120 { return View(this->view(loc
.file_offset
, loc
.data_size
)); }
124 error(const char* format
, ...) const ATTRIBUTE_PRINTF_2
;
126 // Find the .gnu_incremental_inputs and related sections. It selects the
127 // first section of type SHT_GNU_INCREMENTAL_INPUTS,
128 // SHT_GNU_INCRMENTAL_SYMTAB, and SHT_GNU_INCREMENTAL_RELOCS.
129 // Returns false if the sections are not found.
131 find_incremental_inputs_sections(unsigned int* p_inputs_shndx
,
132 unsigned int* p_symtab_shndx
,
133 unsigned int* p_relocs_shndx
,
134 unsigned int* p_strtab_shndx
)
136 return do_find_incremental_inputs_sections(p_inputs_shndx
, p_symtab_shndx
,
137 p_relocs_shndx
, p_strtab_shndx
);
140 // Check the .gnu_incremental_inputs section to see whether an incremental
141 // build is possible.
142 // TODO: on success, should report what files needs to be rebuilt.
143 // INCREMENTAL_INPUTS is used to read the canonical form of the command line
144 // and read the input arguments. TODO: for items that don't need to be
145 // rebuilt, we should also copy the incremental input information.
147 check_inputs(Incremental_inputs
* incremental_inputs
)
148 { return do_check_inputs(incremental_inputs
); }
151 // Find incremental inputs section.
153 do_find_incremental_inputs_sections(unsigned int* p_inputs_shndx
,
154 unsigned int* p_symtab_shndx
,
155 unsigned int* p_relocs_shndx
,
156 unsigned int* p_strtab_shndx
) = 0;
158 // Check the .gnu_incremental_inputs section to see whether an incremental
159 // build is possible.
161 do_check_inputs(Incremental_inputs
* incremental_inputs
) = 0;
164 // Edited output file object.
165 Output_file
* output_
;
166 // Target of the output file.
170 template<int size
, bool big_endian
>
171 class Sized_incremental_binary
: public Incremental_binary
174 Sized_incremental_binary(Output_file
* output
,
175 const elfcpp::Ehdr
<size
, big_endian
>& ehdr
,
177 : Incremental_binary(output
, target
), elf_file_(this, ehdr
)
182 do_find_incremental_inputs_sections(unsigned int* p_inputs_shndx
,
183 unsigned int* p_symtab_shndx
,
184 unsigned int* p_relocs_shndx
,
185 unsigned int* p_strtab_shndx
);
188 do_check_inputs(Incremental_inputs
* incremental_inputs
);
191 // Output as an ELF file.
192 elfcpp::Elf_file
<size
, big_endian
, Incremental_binary
> elf_file_
;
195 // Create an Incremental_binary object for FILE. Returns NULL is this is not
196 // possible, e.g. FILE is not an ELF file or has an unsupported target.
199 open_incremental_binary(Output_file
* file
);
201 // Code invoked early during an incremental link that checks what files need
204 class Incremental_checker
207 // Check if the file named OUTPUT_NAME can be linked incrementally.
208 // INCREMENTAL_INPUTS must have the canonical form of the command line
209 // and input arguments filled - at this point of linking other fields are
210 // probably not filled yet. TODO: for inputs that don't need to be
211 // rebuilt, this function should fill the incremental input information.
212 Incremental_checker(const char* output_name
,
213 Incremental_inputs
* incremental_inputs
)
214 : output_name_(output_name
), incremental_inputs_(incremental_inputs
)
217 // Analyzes the output file to check if incremental linking is possible and
218 // what files needs to be relinked.
220 can_incrementally_link_output_file();
223 // Name of the output file to analyze.
224 const char* output_name_
;
226 // The Incremental_inputs object. At this stage of link, only the command
227 // line and inputs are filled.
228 Incremental_inputs
* incremental_inputs_
;
231 // Base class for recording each input file.
233 class Incremental_input_entry
236 Incremental_input_entry(Stringpool::Key filename_key
, Timespec mtime
)
237 : filename_key_(filename_key
), offset_(0), info_offset_(0), mtime_(mtime
)
240 // Return the type of input file.
241 Incremental_input_type
243 { return this->do_type(); }
245 // Set the section offset of this input file entry.
247 set_offset(unsigned int offset
)
248 { this->offset_
= offset
; }
250 // Set the section offset of the supplemental information for this entry.
252 set_info_offset(unsigned int info_offset
)
253 { this->info_offset_
= info_offset
; }
255 // Get the section offset of this input file entry.
258 { return this->offset_
; }
260 // Get the section offset of the supplemental information for this entry.
262 get_info_offset() const
263 { return this->info_offset_
; }
265 // Get the stringpool key for the input filename.
267 get_filename_key() const
268 { return this->filename_key_
; }
270 // Get the modification time of the input file.
273 { return this->mtime_
; }
275 // Return a pointer to the derived Incremental_script_entry object.
276 // Return NULL for input entries that are not script files.
277 Incremental_script_entry
*
279 { return this->do_script_entry(); }
281 // Return a pointer to the derived Incremental_object_entry object.
282 // Return NULL for input entries that are not object files.
283 Incremental_object_entry
*
285 { return this->do_object_entry(); }
287 // Return a pointer to the derived Incremental_archive_entry object.
288 // Return NULL for input entries that are not archive files.
289 Incremental_archive_entry
*
291 { return this->do_archive_entry(); }
294 // Return the type of input file.
295 virtual Incremental_input_type
298 // Return a pointer to the derived Incremental_script_entry object.
299 // Return NULL for input entries that are not script files.
300 virtual Incremental_script_entry
*
304 // Return a pointer to the derived Incremental_object_entry object.
305 // Return NULL for input entries that are not object files.
306 virtual Incremental_object_entry
*
310 // Return a pointer to the derived Incremental_archive_entry object.
311 // Return NULL for input entries that are not archive files.
312 virtual Incremental_archive_entry
*
317 // Key of the filename string in the section stringtable.
318 Stringpool::Key filename_key_
;
320 // Offset of the entry in the output section.
321 unsigned int offset_
;
323 // Offset of the extra information in the output section.
324 unsigned int info_offset_
;
326 // Last modification time of the file.
330 // Class for recording input scripts.
332 class Incremental_script_entry
: public Incremental_input_entry
335 Incremental_script_entry(Stringpool::Key filename_key
, Script_info
* script
,
337 : Incremental_input_entry(filename_key
, mtime
), script_(script
)
341 virtual Incremental_input_type
343 { return INCREMENTAL_INPUT_SCRIPT
; }
345 // Return a pointer to the derived Incremental_script_entry object.
346 virtual Incremental_script_entry
*
351 // Information about the script file.
352 Script_info
* script_
;
355 // Class for recording input object files.
357 class Incremental_object_entry
: public Incremental_input_entry
360 Incremental_object_entry(Stringpool::Key filename_key
, Object
* obj
,
362 : Incremental_input_entry(filename_key
, mtime
), obj_(obj
),
363 is_member_(false), sections_()
365 if (!obj_
->is_dynamic())
366 this->sections_
.reserve(obj
->shnum());
372 { return this->obj_
; }
374 // Record that this object is an archive member.
377 { this->is_member_
= true; }
379 // Return true if this object is an archive member.
382 { return this->is_member_
; }
384 // Add an input section.
386 add_input_section(unsigned int shndx
, Stringpool::Key name_key
, off_t sh_size
)
388 if (shndx
>= this->sections_
.size())
389 this->sections_
.resize(shndx
+ 1);
390 this->sections_
[shndx
].name_key
= name_key
;
391 this->sections_
[shndx
].sh_size
= sh_size
;
394 // Return the number of input sections in this object.
396 get_input_section_count() const
397 { return this->sections_
.size(); }
399 // Return the stringpool key of the Nth input section.
401 get_input_section_name_key(unsigned int n
) const
402 { return this->sections_
[n
].name_key
; }
404 // Return the size of the Nth input section.
406 get_input_section_size(unsigned int n
) const
407 { return this->sections_
[n
].sh_size
; }
410 virtual Incremental_input_type
413 return (this->is_member_
414 ? INCREMENTAL_INPUT_ARCHIVE_MEMBER
415 : (this->obj_
->is_dynamic()
416 ? INCREMENTAL_INPUT_SHARED_LIBRARY
417 : INCREMENTAL_INPUT_OBJECT
));
420 // Return a pointer to the derived Incremental_object_entry object.
421 virtual Incremental_object_entry
*
426 // The object file itself.
429 // Whether this object is an archive member.
435 Stringpool::Key name_key
;
438 std::vector
<Input_section
> sections_
;
441 // Class for recording archive library input files.
443 class Incremental_archive_entry
: public Incremental_input_entry
446 Incremental_archive_entry(Stringpool::Key filename_key
, Archive
*,
448 : Incremental_input_entry(filename_key
, mtime
), members_(), unused_syms_()
451 // Add a member object to the archive.
453 add_object(Incremental_object_entry
* obj_entry
)
455 this->members_
.push_back(obj_entry
);
456 obj_entry
->set_is_member();
459 // Add an unused global symbol to the archive.
461 add_unused_global_symbol(Stringpool::Key symbol_key
)
462 { this->unused_syms_
.push_back(symbol_key
); }
464 // Return the number of member objects included in the link.
467 { return this->members_
.size(); }
469 // Return the Nth member object.
470 Incremental_object_entry
*
471 get_member(unsigned int n
)
472 { return this->members_
[n
]; }
474 // Return the number of unused global symbols in this archive.
476 get_unused_global_symbol_count()
477 { return this->unused_syms_
.size(); }
479 // Return the Nth unused global symbol.
481 get_unused_global_symbol(unsigned int n
)
482 { return this->unused_syms_
[n
]; }
485 virtual Incremental_input_type
487 { return INCREMENTAL_INPUT_ARCHIVE
; }
489 // Return a pointer to the derived Incremental_archive_entry object.
490 virtual Incremental_archive_entry
*
495 // Members of the archive that have been included in the link.
496 std::vector
<Incremental_object_entry
*> members_
;
498 // Unused global symbols from this archive.
499 std::vector
<Stringpool::Key
> unused_syms_
;
502 // This class contains the information needed during an incremental
503 // build about the inputs necessary to build the .gnu_incremental_inputs.
505 class Incremental_inputs
508 typedef std::vector
<Incremental_input_entry
*> Input_list
;
511 : inputs_(), command_line_(), command_line_key_(0),
512 strtab_(new Stringpool()), current_object_(NULL
),
513 current_object_entry_(NULL
), inputs_section_(NULL
),
514 symtab_section_(NULL
), relocs_section_(NULL
),
518 ~Incremental_inputs() { delete this->strtab_
; }
520 // Record the command line.
522 report_command_line(int argc
, const char* const* argv
);
524 // Record the initial info for archive file ARCHIVE.
526 report_archive_begin(Archive
* arch
);
528 // Record the final info for archive file ARCHIVE.
530 report_archive_end(Archive
* arch
);
532 // Record the info for object file OBJ. If ARCH is not NULL,
533 // attach the object file to the archive.
535 report_object(Object
* obj
, Archive
* arch
);
537 // Record an input section belonging to object file OBJ.
539 report_input_section(Object
* obj
, unsigned int shndx
, const char* name
,
542 // Record the info for input script SCRIPT.
544 report_script(const std::string
& filename
, Script_info
* script
,
547 // Return the running count of incremental relocations.
549 get_reloc_count() const
550 { return this->reloc_count_
; }
552 // Update the running count of incremental relocations.
554 set_reloc_count(unsigned int count
)
555 { this->reloc_count_
= count
; }
557 // Prepare for layout. Called from Layout::finalize.
561 // Create the .gnu_incremental_inputs and related sections.
563 create_data_sections(Symbol_table
* symtab
);
565 // Return the .gnu_incremental_inputs section.
567 inputs_section() const
568 { return this->inputs_section_
; }
570 // Return the .gnu_incremental_symtab section.
572 symtab_section() const
573 { return this->symtab_section_
; }
575 // Return the .gnu_incremental_relocs section.
577 relocs_section() const
578 { return this->relocs_section_
; }
580 // Return the .gnu_incremental_strtab stringpool.
582 get_stringpool() const
583 { return this->strtab_
; }
585 // Return the canonical form of the command line, as will be stored in
586 // .gnu_incremental_strtab.
589 { return this->command_line_
; }
591 // Return the stringpool key of the command line.
593 command_line_key() const
594 { return this->command_line_key_
; }
596 // Return the number of input files.
598 input_file_count() const
599 { return this->inputs_
.size(); }
601 // Return the input files.
604 { return this->inputs_
; }
606 // Return the sh_entsize value for the .gnu_incremental_relocs section.
608 relocs_entsize() const;
611 // The list of input files.
614 // Canonical form of the command line, as will be stored in
615 // .gnu_incremental_strtab.
616 std::string command_line_
;
618 // The key of the command line string in the string pool.
619 Stringpool::Key command_line_key_
;
621 // The .gnu_incremental_strtab string pool associated with the
622 // .gnu_incremental_inputs.
625 // Keep track of the object currently being processed.
626 Object
* current_object_
;
627 Incremental_object_entry
* current_object_entry_
;
629 // The .gnu_incremental_inputs section.
630 Output_section_data
* inputs_section_
;
632 // The .gnu_incremental_symtab section.
633 Output_data_space
* symtab_section_
;
635 // The .gnu_incremental_relocs section.
636 Output_data_space
* relocs_section_
;
638 // Total count of incremental relocations. Updated during Scan_relocs
639 // phase at the completion of each object file.
640 unsigned int reloc_count_
;
643 // Reader class for .gnu_incremental_inputs section.
645 template<int size
, bool big_endian
>
646 class Incremental_inputs_reader
649 typedef elfcpp::Swap
<size
, big_endian
> Swap
;
650 typedef elfcpp::Swap
<16, big_endian
> Swap16
;
651 typedef elfcpp::Swap
<32, big_endian
> Swap32
;
652 typedef elfcpp::Swap
<64, big_endian
> Swap64
;
655 Incremental_inputs_reader(const unsigned char* p
, elfcpp::Elf_strtab
& strtab
)
656 : p_(p
), strtab_(strtab
)
657 { this->input_file_count_
= Swap32::readval(this->p_
+ 4); }
659 // Return the version number.
662 { return Swap32::readval(this->p_
); }
664 // Return the count of input file entries.
666 input_file_count() const
667 { return this->input_file_count_
; }
669 // Return the command line.
673 unsigned int offset
= Swap32::readval(this->p_
+ 8);
674 return this->get_string(offset
);
677 // Reader class for an input file entry and its supplemental info.
678 class Incremental_input_entry_reader
681 Incremental_input_entry_reader(const Incremental_inputs_reader
* inputs
,
683 : inputs_(inputs
), offset_(offset
)
685 this->info_offset_
= Swap32::readval(inputs
->p_
+ offset
+ 4);
686 int type
= Swap16::readval(this->inputs_
->p_
+ offset
+ 20);
687 this->type_
= static_cast<Incremental_input_type
>(type
);
690 // Return the filename.
694 unsigned int offset
= Swap32::readval(this->inputs_
->p_
+ this->offset_
);
695 return this->inputs_
->get_string(offset
);
698 // Return the timestamp.
703 const unsigned char* p
= this->inputs_
->p_
+ this->offset_
+ 8;
704 t
.seconds
= Swap64::readval(p
);
705 t
.nanoseconds
= Swap32::readval(p
+8);
709 // Return the type of input file.
710 Incremental_input_type
712 { return this->type_
; }
714 // Return the input section count -- for objects only.
716 get_input_section_count() const
718 gold_assert(this->type_
== INCREMENTAL_INPUT_OBJECT
719 || this->type_
== INCREMENTAL_INPUT_ARCHIVE_MEMBER
);
720 return Swap32::readval(this->inputs_
->p_
+ this->info_offset_
);
723 // Return the offset of the supplemental info for symbol SYMNDX --
726 get_symbol_offset(unsigned int symndx
) const
728 gold_assert(this->type_
== INCREMENTAL_INPUT_OBJECT
729 || this->type_
== INCREMENTAL_INPUT_ARCHIVE_MEMBER
);
731 unsigned int section_count
= this->get_input_section_count();
732 return (this->info_offset_
+ 8
733 + section_count
* input_section_entry_size
737 // Return the global symbol count -- for objects & shared libraries only.
739 get_global_symbol_count() const
743 case INCREMENTAL_INPUT_OBJECT
:
744 case INCREMENTAL_INPUT_ARCHIVE_MEMBER
:
745 return Swap32::readval(this->inputs_
->p_
+ this->info_offset_
+ 4);
746 case INCREMENTAL_INPUT_SHARED_LIBRARY
:
747 return Swap32::readval(this->inputs_
->p_
+ this->info_offset_
);
753 // Return the member count -- for archives only.
755 get_member_count() const
757 gold_assert(this->type_
== INCREMENTAL_INPUT_ARCHIVE
);
758 return Swap32::readval(this->inputs_
->p_
+ this->info_offset_
);
761 // Return the unused symbol count -- for archives only.
763 get_unused_symbol_count() const
765 gold_assert(this->type_
== INCREMENTAL_INPUT_ARCHIVE
);
766 return Swap32::readval(this->inputs_
->p_
+ this->info_offset_
+ 4);
769 // Return the input file offset for archive member N -- for archives only.
771 get_member_offset(unsigned int n
) const
773 gold_assert(this->type_
== INCREMENTAL_INPUT_ARCHIVE
);
774 return Swap32::readval(this->inputs_
->p_
+ this->info_offset_
778 // Return the Nth unused global symbol -- for archives only.
780 get_unused_symbol(unsigned int n
) const
782 gold_assert(this->type_
== INCREMENTAL_INPUT_ARCHIVE
);
783 unsigned int member_count
= this->get_member_count();
784 unsigned int offset
= Swap32::readval(this->inputs_
->p_
785 + this->info_offset_
+ 8
788 return this->inputs_
->get_string(offset
);
791 // Information about an input section.
792 struct Input_section_info
795 unsigned int output_shndx
;
800 // Return info about the Nth input section -- for objects only.
802 get_input_section(unsigned int n
) const
804 Input_section_info info
;
805 const unsigned char* p
= (this->inputs_
->p_
806 + this->info_offset_
+ 8
807 + n
* input_section_entry_size
);
808 unsigned int name_offset
= Swap32::readval(p
);
809 info
.name
= this->inputs_
->get_string(name_offset
);
810 info
.output_shndx
= Swap32::readval(p
+ 4);
811 info
.sh_offset
= Swap::readval(p
+ 8);
812 info
.sh_size
= Swap::readval(p
+ 8 + size
/ 8);
816 // Information about a global symbol.
817 struct Global_symbol_info
819 unsigned int output_symndx
;
820 unsigned int next_offset
;
821 unsigned int reloc_count
;
822 unsigned int reloc_offset
;
825 // Return info about the Nth global symbol -- for objects only.
827 get_global_symbol_info(unsigned int n
) const
829 Global_symbol_info info
;
830 unsigned int section_count
= this->get_input_section_count();
831 const unsigned char* p
= (this->inputs_
->p_
832 + this->info_offset_
+ 8
833 + section_count
* input_section_entry_size
835 info
.output_symndx
= Swap32::readval(p
);
836 info
.next_offset
= Swap32::readval(p
+ 4);
837 info
.reloc_count
= Swap::readval(p
+ 8);
838 info
.reloc_offset
= Swap::readval(p
+ 12);
843 // Size of an input section entry.
844 static const unsigned int input_section_entry_size
= 8 + 2 * size
/ 8;
845 // The reader instance for the containing section.
846 const Incremental_inputs_reader
* inputs_
;
847 // The type of input file.
848 Incremental_input_type type_
;
849 // Section offset to the input file entry.
850 unsigned int offset_
;
851 // Section offset to the supplemental info for the input file.
852 unsigned int info_offset_
;
855 // Return a reader for the Nth input file entry.
856 Incremental_input_entry_reader
857 input_file(unsigned int n
) const
859 gold_assert(n
< this->input_file_count_
);
860 Incremental_input_entry_reader
input(this, 16 + n
* 24);
865 // Lookup a string in the ELF string table.
866 const char* get_string(unsigned int offset
) const
869 if (this->strtab_
.get_c_string(offset
, &s
))
874 // Base address of the .gnu_incremental_inputs section.
875 const unsigned char* p_
;
876 // The associated ELF string table.
877 elfcpp::Elf_strtab strtab_
;
878 // The number of input file entries in this section.
879 unsigned int input_file_count_
;
882 // Reader class for the .gnu_incremental_symtab section.
884 template<bool big_endian
>
885 class Incremental_symtab_reader
888 Incremental_symtab_reader(const unsigned char* p
) : p_(p
)
891 // Return the list head for symbol table entry N.
892 unsigned int get_list_head(unsigned int n
)
893 { return elfcpp::Swap
<32, big_endian
>::readval(this->p_
+ 4 * n
); }
896 // Base address of the .gnu_incremental_relocs section.
897 const unsigned char* p_
;
900 // Reader class for the .gnu_incremental_relocs section.
902 template<int size
, bool big_endian
>
903 class Incremental_relocs_reader
906 // Size of each field.
907 static const unsigned int field_size
= size
/ 8;
910 typedef typename
elfcpp::Elf_types
<size
>::Elf_Addr Address
;
911 typedef typename
elfcpp::Elf_types
<size
>::Elf_Swxword Addend
;
913 // Size of each entry.
914 static const unsigned int reloc_size
= 8 + 2 * field_size
;
916 Incremental_relocs_reader(const unsigned char* p
) : p_(p
)
919 // Return the relocation type for relocation entry at offset OFF.
921 get_r_type(unsigned int off
)
923 return elfcpp::Swap
<32, big_endian
>::readval(this->p_
+ off
);
926 // Return the output section index for relocation entry at offset OFF.
928 get_r_shndx(unsigned int off
)
930 return elfcpp::Swap
<32, big_endian
>::readval(this->p_
+ off
+ 4);
933 // Return the output section offset for relocation entry at offset OFF.
935 get_r_offset(unsigned int off
)
937 return elfcpp::Swap
<size
, big_endian
>::readval(this->p_
+ off
+ 8);
940 // Return the addend for relocation entry at offset OFF.
942 get_r_addend(unsigned int off
)
944 return elfcpp::Swap
<size
, big_endian
>::readval(this->p_
+ off
+ 8
949 // Base address of the .gnu_incremental_relocs section.
950 const unsigned char* p_
;
953 } // End namespace gold.
955 #endif // !defined(GOLD_INCREMENTAL_H)