* dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
authorAlan Modra <amodra@gmail.com>
Thu, 21 Mar 2013 02:00:16 +0000 (02:00 +0000)
committerAlan Modra <amodra@gmail.com>
Thu, 21 Mar 2013 02:00:16 +0000 (02:00 +0000)
comparison warning.
* layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
uninitialized" warning.

gold/ChangeLog
gold/dwp.cc
gold/layout.cc

index 8c3b1a28875d91045c1c5858faffed3d6f6c7d22..52c2067e101c01941e4ab96a1bff1fd5a3d3ebd1 100644 (file)
@@ -1,3 +1,10 @@
+2013-03-21  Alan Modra  <amodra@gmail.com>
+
+       * dwp.cc (Dwp_output_file::add_contribution): Avoid signed/unsigned
+       comparison warning.
+       * layout.cc (Layout::create_dynamic_symtab): Avoid "may be used
+       uninitialized" warning.
+
 2013-03-20  Alan Modra  <amodra@gmail.com>
 
        * symtab.h (Symbol::clear_version): New function.
index eb9e152fa95e5e57cc4c207c18a0537eb707feac..c6453bfdef1962f468b5ecf1746d744d11f15012 100644 (file)
@@ -1476,7 +1476,7 @@ Dwp_output_file::add_contribution(elfcpp::DW_SECT section_id,
                                  int align)
 {
   const char* section_name = get_dwarf_section_name(section_id);
-  gold_assert(section_id < this->section_id_map_.size());
+  gold_assert(static_cast<size_t>(section_id) < this->section_id_map_.size());
   unsigned int shndx = this->section_id_map_[section_id];
 
   // Create the section if necessary.
index faa8f7161845544ba6b6d8f411120d839a294028..4c48c3c4bb686d5a5b4dc8a847d6e8dc4a254197 100644 (file)
@@ -4158,7 +4158,7 @@ Layout::create_dynamic_symtab(const Input_objects* input_objects,
                                                       false,
                                                       ORDER_DYNAMIC_LINKER,
                                                       false);
-
+  *pdynstr = dynstr;
   if (dynstr != NULL)
     {
       Output_section_data* strdata = new Output_data_strtab(&this->dynpool_);
@@ -4174,8 +4174,6 @@ Layout::create_dynamic_symtab(const Input_objects* input_objects,
          odyn->add_section_address(elfcpp::DT_STRTAB, dynstr);
          odyn->add_section_size(elfcpp::DT_STRSZ, dynstr);
        }
-
-      *pdynstr = dynstr;
     }
 
   // Create the hash tables.