* output.h (Output_section_lookup_maps::add_merge_section):
authorIan Lance Taylor <ian@airs.com>
Tue, 13 Jul 2010 12:04:03 +0000 (12:04 +0000)
committerIan Lance Taylor <ian@airs.com>
Tue, 13 Jul 2010 12:04:03 +0000 (12:04 +0000)
Correct check of whether value was inserted.
(Output_section_lookup_maps::add_merge_input_section): Likewise.
(Output_section_lookup_maps::add_relaxed_input_section):
Likewise.
* arm.cc (Target_arm::got_section): Remove used local os.
* i386.cc (Target_i386::got_section): Likewise.
* x86_64.cc (Target_x86_64::got_section): Likewise.
* sparc.cc (Target_sparc::got_section): Likewise.
(Target_sparc::relocate): Remove unused local have_got_offset.
* powerpc.cc (Target_powerpc::relocate): Likewise.

gold/ChangeLog
gold/arm.cc
gold/i386.cc
gold/output.h
gold/powerpc.cc
gold/sparc.cc
gold/x86_64.cc

index 1c5b157a4171b017060dc028439abd55e61d4852..8d7526961c8a1e464764363e4693a21a11f79f56 100644 (file)
@@ -1,3 +1,18 @@
+2010-07-13  Philip Herron  <herron.philip@googlemail.com>
+           Ian Lance Taylor  <iant@google.com>
+
+       * output.h (Output_section_lookup_maps::add_merge_section):
+       Correct check of whether value was inserted.
+       (Output_section_lookup_maps::add_merge_input_section): Likewise.
+       (Output_section_lookup_maps::add_relaxed_input_section):
+       Likewise.
+       * arm.cc (Target_arm::got_section): Remove used local os.
+       * i386.cc (Target_i386::got_section): Likewise.
+       * x86_64.cc (Target_x86_64::got_section): Likewise.
+       * sparc.cc (Target_sparc::got_section): Likewise.
+       (Target_sparc::relocate): Remove unused local have_got_offset.
+       * powerpc.cc (Target_powerpc::relocate): Likewise.
+
 2010-07-13  Ian Lance Taylor  <iant@google.com>
 
        * compressed_output.cc (zlib_decompress): Fix signature in
index 76d466b97d4aa782617c8787df4c7c0a90179e79..ddfe543ecbbb7d8a55931bab23701c2bdbcc1ca9 100644 (file)
@@ -4116,22 +4116,20 @@ Target_arm<big_endian>::got_section(Symbol_table* symtab, Layout* layout)
 
       this->got_ = new Arm_output_data_got<big_endian>(symtab, layout);
 
-      Output_section* os;
-      os = layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
-                                          (elfcpp::SHF_ALLOC
-                                           | elfcpp::SHF_WRITE),
-                                          this->got_, false, false, false,
-                                          true);
+      layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
+                                     (elfcpp::SHF_ALLOC
+                                      | elfcpp::SHF_WRITE),
+                                     this->got_, false, false, false, true);
       // The old GNU linker creates a .got.plt section.  We just
       // create another set of data in the .got section.  Note that we
       // always create a PLT if we create a GOT, although the PLT
       // might be empty.
       this->got_plt_ = new Output_data_space(4, "** GOT PLT");
-      os = layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
-                                          (elfcpp::SHF_ALLOC
-                                           | elfcpp::SHF_WRITE),
-                                          this->got_plt_, false, false,
-                                          false, false);
+      layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
+                                     (elfcpp::SHF_ALLOC
+                                      | elfcpp::SHF_WRITE),
+                                     this->got_plt_, false, false, false,
+                                     false);
 
       // The first three entries are reserved.
       this->got_plt_->set_current_data_size(3 * 4);
index 1776383249f58ba2f90f371a74e3b26aa8d7b54c..e49207a580547117e0a653ed6b99af56cba8f855 100644 (file)
@@ -494,19 +494,17 @@ Target_i386::got_section(Symbol_table* symtab, Layout* layout)
 
       this->got_ = new Output_data_got<32, false>();
 
-      Output_section* os;
-      os = layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
-                                          (elfcpp::SHF_ALLOC
-                                           | elfcpp::SHF_WRITE),
-                                          this->got_, false, true, true,
-                                          false);
+      layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
+                                     (elfcpp::SHF_ALLOC
+                                      | elfcpp::SHF_WRITE),
+                                     this->got_, false, true, true, false);
 
       this->got_plt_ = new Output_data_space(4, "** GOT PLT");
-      os = layout->add_output_section_data(".got.plt", elfcpp::SHT_PROGBITS,
-                                          (elfcpp::SHF_ALLOC
-                                           | elfcpp::SHF_WRITE),
-                                          this->got_plt_, false, false, false,
-                                          true);
+      layout->add_output_section_data(".got.plt", elfcpp::SHT_PROGBITS,
+                                     (elfcpp::SHF_ALLOC
+                                      | elfcpp::SHF_WRITE),
+                                     this->got_plt_, false, false, false,
+                                     true);
 
       // The first three entries are reserved.
       this->got_plt_->set_current_data_size(3 * 4);
index 1a0a8da42c4cdbd0f0478169a77ddc0b30dbe849..735571839c94920401d2d7d156826b69d71ec9a9 100644 (file)
@@ -2432,7 +2432,7 @@ class Output_section_lookup_maps
     std::pair<Merge_section_properties, Output_merge_base*> value(msp, pomb);
     std::pair<Merge_sections_by_properties::iterator, bool> result =
       this->merge_sections_by_properties_.insert(value);
-    gold_assert(value.second);
+    gold_assert(result.second);
   }
   
   // Add a mapping from a merged input section in OBJECT with index SHNDX
@@ -2445,7 +2445,7 @@ class Output_section_lookup_maps
     std::pair<Const_section_id, Output_merge_base*> value(csid, pomb);
     std::pair<Merge_sections_by_id::iterator, bool> result =
       this->merge_sections_by_id_.insert(value);
-    gold_assert(value.second);
+    gold_assert(result.second);
   }
 
   // Find a relaxed input section of OBJECT with index SHNDX.
@@ -2469,7 +2469,7 @@ class Output_section_lookup_maps
       value(csid, poris);
     std::pair<Relaxed_input_sections_by_id::iterator, bool> result =
       this->relaxed_input_sections_by_id_.insert(value);
-    gold_assert(value.second);
+    gold_assert(result.second);
   }
 
  private:
index 0eda0a9edfd64876e0a2d484fd5ceea4f96a66af..627911c770091dcafeb4683a46ce87a9167bd23f 100644 (file)
@@ -1636,7 +1636,6 @@ Target_powerpc<size, big_endian>::Relocate::relocate(
   // Get the GOT offset if needed.  Unlike i386 and x86_64, our GOT
   // pointer points to the beginning, not the end, of the table.
   // So we just use the plain offset.
-  bool have_got_offset = false;
   unsigned int got_offset = 0;
   unsigned int got2_offset = 0;
   switch (r_type)
@@ -1668,7 +1667,6 @@ Target_powerpc<size, big_endian>::Relocate::relocate(
           gold_assert(object->local_has_got_offset(r_sym, GOT_TYPE_STANDARD));
           got_offset = object->local_got_offset(r_sym, GOT_TYPE_STANDARD);
         }
-      have_got_offset = true;
       break;
 
       // R_PPC_PLTREL24 is rather special.  If non-zero,
@@ -1681,7 +1679,6 @@ Target_powerpc<size, big_endian>::Relocate::relocate(
          got2_offset = got2->offset();
          addend += got2_offset;
        }
-      have_got_offset = true;
       break;
 
     default:
index e2d59b943a47fd99995b8e11fdfe71334c23cf87..90e5ae3481cdb7a6f3a197e801e1244b90e49230 100644 (file)
@@ -1045,12 +1045,10 @@ Target_sparc<size, big_endian>::got_section(Symbol_table* symtab,
 
       this->got_ = new Output_data_got<size, big_endian>();
 
-      Output_section* os;
-      os = layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
-                                          (elfcpp::SHF_ALLOC
-                                           | elfcpp::SHF_WRITE),
-                                          this->got_, false, true, false,
-                                          false);
+      layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
+                                     (elfcpp::SHF_ALLOC
+                                      | elfcpp::SHF_WRITE),
+                                     this->got_, false, true, false, false);
 
       // Define _GLOBAL_OFFSET_TABLE_ at the start of the .got section.
       symtab->define_in_output_data("_GLOBAL_OFFSET_TABLE_", NULL,
@@ -2474,7 +2472,6 @@ Target_sparc<size, big_endian>::Relocate::relocate(
   // Get the GOT offset if needed.  Unlike i386 and x86_64, our GOT
   // pointer points to the beginning, not the end, of the table.
   // So we just use the plain offset.
-  bool have_got_offset = false;
   unsigned int got_offset = 0;
   switch (r_type)
     {
@@ -2495,7 +2492,6 @@ Target_sparc<size, big_endian>::Relocate::relocate(
           gold_assert(object->local_has_got_offset(r_sym, GOT_TYPE_STANDARD));
           got_offset = object->local_got_offset(r_sym, GOT_TYPE_STANDARD);
         }
-      have_got_offset = true;
       break;
 
     default:
index 9110278ebb8414ef2dcccc822734202aad21a320..1dba535138c5f0b88e215cfb6c1776f9c54b42ca 100644 (file)
@@ -547,19 +547,17 @@ Target_x86_64::got_section(Symbol_table* symtab, Layout* layout)
 
       this->got_ = new Output_data_got<64, false>();
 
-      Output_section* os;
-      os = layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
-                                          (elfcpp::SHF_ALLOC
-                                           | elfcpp::SHF_WRITE),
-                                          this->got_, false, true, true,
-                                          false);
+      layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
+                                     (elfcpp::SHF_ALLOC
+                                      | elfcpp::SHF_WRITE),
+                                     this->got_, false, true, true, false);
 
       this->got_plt_ = new Output_data_space(8, "** GOT PLT");
-      os = layout->add_output_section_data(".got.plt", elfcpp::SHT_PROGBITS,
-                                          (elfcpp::SHF_ALLOC
-                                           | elfcpp::SHF_WRITE),
-                                          this->got_plt_, false, false,
-                                          false, true);
+      layout->add_output_section_data(".got.plt", elfcpp::SHT_PROGBITS,
+                                     (elfcpp::SHF_ALLOC
+                                      | elfcpp::SHF_WRITE),
+                                     this->got_plt_, false, false, false,
+                                     true);
 
       // The first three entries are reserved.
       this->got_plt_->set_current_data_size(3 * 8);
This page took 0.038664 seconds and 4 git commands to generate.