aboutsummaryrefslogtreecommitdiff
path: root/gold/output.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2008-05-05 19:16:43 +0000
committerIan Lance Taylor <ian@airs.com>2008-05-05 19:16:43 +0000
commit8825ac63ef01c08e4668e652d461f94e6761a312 (patch)
tree535e0e766b8a0a6473bd103a911c07f6c80fff9b /gold/output.cc
parentb3dc826bc7308d6e556424dd369d57fe8acc8a96 (diff)
downloadfsf-binutils-gdb-8825ac63ef01c08e4668e652d461f94e6761a312.zip
fsf-binutils-gdb-8825ac63ef01c08e4668e652d461f94e6761a312.tar.gz
fsf-binutils-gdb-8825ac63ef01c08e4668e652d461f94e6761a312.tar.bz2
* object.cc (Sized_relobj::include_section_group): Adjust section
indexes read from group data. Build vector to pass to layout_group. * layout.cc (Layout::layout_group): Add flags and shndxes parameters. Remove contents parameter. Change caller. Update explicit instantiations. * layout.h (class Layout): Update layout_group declaration. * output.cc (Output_data_group::Output_data_group): Add flags and input_shndxes parameters. Remove contents parameter. Change caller. (Output_data_group::do_write): Change input_sections_ to input_shndxes_. * output.h (class Output_data_group): Update constructor declaration. Rename input_sections_ to input_shndxes_. * testsuite/many_sections_test.cc: Add template.
Diffstat (limited to 'gold/output.cc')
-rw-r--r--gold/output.cc19
1 files changed, 8 insertions, 11 deletions
diff --git a/gold/output.cc b/gold/output.cc
index ded6d42..a3c1f85 100644
--- a/gold/output.cc
+++ b/gold/output.cc
@@ -997,16 +997,13 @@ template<int size, bool big_endian>
Output_data_group<size, big_endian>::Output_data_group(
Sized_relobj<size, big_endian>* relobj,
section_size_type entry_count,
- const elfcpp::Elf_Word* contents)
+ elfcpp::Elf_Word flags,
+ std::vector<unsigned int>* input_shndxes)
: Output_section_data(entry_count * 4, 4),
- relobj_(relobj)
+ relobj_(relobj),
+ flags_(flags)
{
- this->flags_ = elfcpp::Swap<32, big_endian>::readval(contents);
- for (section_size_type i = 1; i < entry_count; ++i)
- {
- unsigned int shndx = elfcpp::Swap<32, big_endian>::readval(contents + i);
- this->input_sections_.push_back(shndx);
- }
+ this->input_shndxes_.swap(*input_shndxes);
}
// Write out the section group, which means translating the section
@@ -1026,8 +1023,8 @@ Output_data_group<size, big_endian>::do_write(Output_file* of)
++contents;
for (std::vector<unsigned int>::const_iterator p =
- this->input_sections_.begin();
- p != this->input_sections_.end();
+ this->input_shndxes_.begin();
+ p != this->input_shndxes_.end();
++p, ++contents)
{
section_offset_type dummy;
@@ -1052,7 +1049,7 @@ Output_data_group<size, big_endian>::do_write(Output_file* of)
of->write_output_view(off, oview_size, oview);
// We no longer need this information.
- this->input_sections_.clear();
+ this->input_shndxes_.clear();
}
// Output_data_got::Got_entry methods.