From 22b127cceb64a4a8dc7e62591746eb4c178eff9f Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 4 Nov 2009 16:35:51 +0000 Subject: PR 10887 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic tags if data is discarded by linker script. * 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. --- gold/sparc.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gold/sparc.cc') diff --git a/gold/sparc.cc b/gold/sparc.cc index 25f03d1..d344af2 100644 --- a/gold/sparc.cc +++ b/gold/sparc.cc @@ -2325,7 +2325,8 @@ Target_sparc::do_finalize_sections( Output_data_dynamic* const odyn = layout->dynamic_data(); if (odyn != NULL) { - if (this->plt_ != NULL) + 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); @@ -2335,7 +2336,8 @@ Target_sparc::do_finalize_sections( odyn->add_section_address(elfcpp::DT_PLTGOT, this->plt_); } - if (this->rela_dyn_ != NULL) + if (this->rela_dyn_ != NULL + && this->rela_dyn_->output_section() != NULL) { const Output_data* od = this->rela_dyn_; odyn->add_section_address(elfcpp::DT_RELA, od); -- cgit v1.1