]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR 10887
authorIan Lance Taylor <ian@airs.com>
Wed, 4 Nov 2009 16:36:08 +0000 (16:36 +0000)
committerIan Lance Taylor <ian@airs.com>
Wed, 4 Nov 2009 16:36:08 +0000 (16:36 +0000)
* 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/ChangeLog
gold/arm.cc
gold/i386.cc
gold/powerpc.cc
gold/sparc.cc
gold/x86_64.cc

index 5589cd7b375fd4bcaad3a0aee31baecbf1801a0b..35a58f9679e2ceb396e1065059cadd0d0b23aabd 100644 (file)
@@ -1,3 +1,13 @@
+2009-11-04  Ian Lance Taylor  <iant@google.com>
+
+       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.
+
 2009-11-04  Ian Lance Taylor  <iant@google.com>
 
        * layout.cc (Layout::get_output_section): Add is_interp and
index 72f56ccd5fe054763f80317ae298e14ce7f58b1e..c1615f08c8b62d1bde96facde4693289463fa9a5 100644 (file)
@@ -1831,10 +1831,12 @@ Target_arm<big_endian>::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);
@@ -1842,7 +1844,8 @@ Target_arm<big_endian>::do_finalize_sections(Layout* layout)
          odyn->add_constant(elfcpp::DT_PLTREL, elfcpp::DT_REL);
        }
 
-      if (this->rel_dyn_ != NULL)
+      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);
index aa2d650621dfeb82226196a54ff57082c3efedba..f21cf7432d7c738655a9145df87936749f9dc14e 100644 (file)
@@ -1569,10 +1569,12 @@ Target_i386::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);
@@ -1580,7 +1582,8 @@ Target_i386::do_finalize_sections(Layout* layout)
          odyn->add_constant(elfcpp::DT_PLTREL, elfcpp::DT_REL);
        }
 
-      if (this->rel_dyn_ != NULL)
+      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);
index c0bb17ffc367ff6c014400f1d2195cbbc34a5c0f..9aacbf34763a7f77ab60c2b6c521efd765f1deec 100644 (file)
@@ -1547,7 +1547,8 @@ Target_powerpc<size, big_endian>::do_finalize_sections(Layout* layout)
   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);
@@ -1557,7 +1558,8 @@ Target_powerpc<size, big_endian>::do_finalize_sections(Layout* layout)
          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);
index c17d3d8b269cf7d687d3103b1dfa885481e8a709..55a04d96232c554606f61b65fd34a64d79bf0454 100644 (file)
@@ -2334,7 +2334,8 @@ Target_sparc<size, big_endian>::do_finalize_sections(Layout* layout)
   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);
@@ -2344,7 +2345,8 @@ Target_sparc<size, big_endian>::do_finalize_sections(Layout* layout)
          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);
index 0f3705c0c723b00c32e27dee96faeeb225f7637b..c6b5f9425493dfa632dc671bb1f6ed43c8575c35 100644 (file)
@@ -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);