const char* name, const elfcpp::Shdr<size, big_endian>& shdr,
unsigned int reloc_shndx, unsigned int reloc_type, off_t* offset);
+ // Layout an input reloc section when doing a relocatable link. The
+ // section is RELOC_SHNDX in OBJECT, with data in SHDR.
+ // DATA_SECTION is the reloc section to which it refers. RR is the
+ // relocatable information.
+ template<int size, bool big_endian>
+ Output_section*
+ layout_reloc(Sized_relobj<size, big_endian>* object,
+ unsigned int reloc_shndx,
+ const elfcpp::Shdr<size, big_endian>& shdr,
+ Output_section* data_section,
+ Relocatable_relocs* rr);
+
+ // Layout a group section when doing a relocatable link.
+ template<int size, bool big_endian>
+ void
+ layout_group(Symbol_table* symtab,
+ Sized_relobj<size, big_endian>* object,
+ unsigned int group_shndx,
+ const char* group_section_name,
+ const char* signature,
+ const elfcpp::Shdr<size, big_endian>& shdr,
+ const elfcpp::Elf_Word* contents);
+
// Like layout, only for exception frame sections. OBJECT is an
// object file. SYMBOLS is the contents of the symbol table
// section, with size SYMBOLS_SIZE. SYMBOL_NAMES is the contents of
define_script_symbols(Symbol_table* symtab)
{ this->script_options_->add_symbols_to_table(symtab); }
+ // Define symbols for group signatures.
+ void
+ define_group_signatures(Symbol_table*);
+
// Return the Stringpool used for symbol names.
const Stringpool*
sympool() const
static const Linkonce_mapping linkonce_mapping[];
static const int linkonce_mapping_count;
+ // During a relocatable link, a list of group sections and
+ // signatures.
+ struct Group_signature
+ {
+ // The group section.
+ Output_section* section;
+ // The signature.
+ const char* signature;
+
+ Group_signature()
+ : section(NULL), signature(NULL)
+ { }
+
+ Group_signature(Output_section* sectiona, const char* signaturea)
+ : section(sectiona), signature(signaturea)
+ { }
+ };
+ typedef std::vector<Group_signature> Group_signatures;
+
// Create a .note section for gold.
void
create_gold_note();
off_t
set_segment_offsets(const Target*, Output_segment*, unsigned int* pshndx);
+ // Set the file offsets of the sections when doing a relocatable
+ // link.
+ off_t
+ set_relocatable_section_offsets(Output_data*, unsigned int* pshndx);
+
// Set the final file offsets of all the sections not associated
// with a segment. We set section offsets in three passes: the
// first handles all allocated sections, the second sections that
Eh_frame* eh_frame_data_;
// The exception frame header output section if there is one.
Output_section* eh_frame_hdr_section_;
+ // A list of group sections and their signatures.
+ Group_signatures group_signatures_;
// The size of the output file.
off_t output_file_size_;
// Whether we have seen an object file marked to require an