| Index: binutils/gold/x86_64.cc
|
| diff --git a/binutils/gold/x86_64.cc b/binutils/gold/x86_64.cc
|
| index 3562065611b56bb59bcb6b859854bba6807b448b..c6b5f9425493dfa632dc671bb1f6ed43c8575c35 100644
|
| --- a/binutils/gold/x86_64.cc
|
| +++ b/binutils/gold/x86_64.cc
|
| @@ -472,7 +472,7 @@ Target_x86_64::got_section(Symbol_table* symtab, Layout* layout)
|
| os = layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
|
| (elfcpp::SHF_ALLOC
|
| | elfcpp::SHF_WRITE),
|
| - this->got_);
|
| + this->got_, false);
|
| os->set_is_relro();
|
|
|
| // The old GNU linker creates a .got.plt section. We just
|
| @@ -483,7 +483,7 @@ Target_x86_64::got_section(Symbol_table* symtab, Layout* layout)
|
| os = layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
|
| (elfcpp::SHF_ALLOC
|
| | elfcpp::SHF_WRITE),
|
| - this->got_plt_);
|
| + this->got_plt_, false);
|
| os->set_is_relro();
|
|
|
| // The first three entries are reserved.
|
| @@ -511,7 +511,7 @@ Target_x86_64::rela_dyn_section(Layout* layout)
|
| gold_assert(layout != NULL);
|
| this->rela_dyn_ = new Reloc_section(parameters->options().combreloc());
|
| layout->add_output_section_data(".rela.dyn", elfcpp::SHT_RELA,
|
| - elfcpp::SHF_ALLOC, this->rela_dyn_);
|
| + elfcpp::SHF_ALLOC, this->rela_dyn_, true);
|
| }
|
| return this->rela_dyn_;
|
| }
|
| @@ -611,7 +611,7 @@ Output_data_plt_x86_64::Output_data_plt_x86_64(Layout* layout,
|
| {
|
| this->rel_ = new Reloc_section(false);
|
| layout->add_output_section_data(".rela.plt", elfcpp::SHT_RELA,
|
| - elfcpp::SHF_ALLOC, this->rel_);
|
| + elfcpp::SHF_ALLOC, this->rel_, true);
|
| }
|
|
|
| void
|
| @@ -807,7 +807,7 @@ Target_x86_64::make_plt_section(Symbol_table* symtab, Layout* layout)
|
| layout->add_output_section_data(".plt", elfcpp::SHT_PROGBITS,
|
| (elfcpp::SHF_ALLOC
|
| | elfcpp::SHF_EXECINSTR),
|
| - this->plt_);
|
| + this->plt_, false);
|
| }
|
| }
|
|
|
| @@ -1659,10 +1659,12 @@ Target_x86_64::do_finalize_sections(Layout* layout)
|
| 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);
|
| @@ -1680,7 +1682,8 @@ Target_x86_64::do_finalize_sections(Layout* layout)
|
| }
|
| }
|
|
|
| - 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);
|
|
|