aboutsummaryrefslogtreecommitdiff
path: root/gold/x86_64.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gold/x86_64.cc')
-rw-r--r--gold/x86_64.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/gold/x86_64.cc b/gold/x86_64.cc
index c325fc0..cbc45be 100644
--- a/gold/x86_64.cc
+++ b/gold/x86_64.cc
@@ -1648,10 +1648,12 @@ Target_x86_64::do_finalize_sections(Layout* layout, const Input_objects*)
Output_data_dynamic* const odyn = layout->dynamic_data();
if (odyn != NULL)
{
- if (this->got_plt_ != 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)
+ 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);
@@ -1669,7 +1671,8 @@ Target_x86_64::do_finalize_sections(Layout* layout, const Input_objects*)
}
}
- 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);