aboutsummaryrefslogtreecommitdiff
path: root/gold/i386.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2010-01-07 20:43:35 +0000
committerIan Lance Taylor <ian@airs.com>2010-01-07 20:43:35 +0000
commitea715a34a7803993d232d8b85dbd77ca537190e6 (patch)
tree4fbc5d6e8c0a59a68e16dda8cb19459ec0c76bfa /gold/i386.cc
parent3a08d52f28cafb9fca077d58be4f0cdb42f3f655 (diff)
downloadgdb-ea715a34a7803993d232d8b85dbd77ca537190e6.zip
gdb-ea715a34a7803993d232d8b85dbd77ca537190e6.tar.gz
gdb-ea715a34a7803993d232d8b85dbd77ca537190e6.tar.bz2
* output.h (class Output_data): Add const version of
output_section and do_output_section. (class Output_section_data): Add const version of do_output_section. (class Output_section): Likewise. * layout.cc (Layout::add_target_dynamic_tags): New function. * layout.h (class Layout): Update declarations. * arm.cc (Target_arm::do_finalize_sections): Use add_target_dynamic_tags. * i386.cc (Target_i386::do_finalize_sections): Likewise. * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise. * sparc.cc (Target_sparc::do_finalize_sections): Likewise. * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
Diffstat (limited to 'gold/i386.cc')
-rw-r--r--gold/i386.cc39
1 files changed, 5 insertions, 34 deletions
diff --git a/gold/i386.cc b/gold/i386.cc
index 1044ad8..e1b32e7 100644
--- a/gold/i386.cc
+++ b/gold/i386.cc
@@ -1565,40 +1565,11 @@ Target_i386::do_finalize_sections(
const Input_objects*,
Symbol_table* symtab)
{
- // Fill in some more dynamic tags.
- Output_data_dynamic* const odyn = layout->dynamic_data();
- if (odyn != NULL)
- {
- if (this->got_plt_ != NULL
- && this->got_plt_->output_section() != NULL)
- odyn->add_section_address(elfcpp::DT_PLTGOT, this->got_plt_);
-
- if (this->plt_ != NULL
- && this->plt_->output_section() != NULL)
- {
- const Output_data* od = this->plt_->rel_plt();
- odyn->add_section_size(elfcpp::DT_PLTRELSZ, od);
- odyn->add_section_address(elfcpp::DT_JMPREL, od);
- odyn->add_constant(elfcpp::DT_PLTREL, elfcpp::DT_REL);
- }
-
- if (this->rel_dyn_ != NULL
- && this->rel_dyn_->output_section() != NULL)
- {
- const Output_data* od = this->rel_dyn_;
- odyn->add_section_address(elfcpp::DT_REL, od);
- odyn->add_section_size(elfcpp::DT_RELSZ, od);
- odyn->add_constant(elfcpp::DT_RELENT,
- elfcpp::Elf_sizes<32>::rel_size);
- }
-
- if (!parameters->options().shared())
- {
- // The value of the DT_DEBUG tag is filled in by the dynamic
- // linker at run time, and used by the debugger.
- odyn->add_constant(elfcpp::DT_DEBUG, 0);
- }
- }
+ const Reloc_section* rel_plt = (this->plt_ == NULL
+ ? NULL
+ : this->plt_->rel_plt());
+ layout->add_target_dynamic_tags(true, this->got_plt_, rel_plt,
+ this->rel_dyn_, true);
// Emit any relocs we saved in an attempt to avoid generating COPY
// relocs.