From: Roland McGrath Date: Wed, 7 Nov 2012 17:31:30 +0000 (+0000) Subject: gold/ X-Git-Tag: binutils-2_23_1~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c86c8fbb5e93ee50d4ea2fc988d15b50173ee094;p=thirdparty%2Fbinutils-gdb.git gold/ * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast SYMNDX to off_t before comparing it to this->data_size(). * output.cc (Output_symtab_xindex::endian_do_write): Likewise. * incremental.cc (Output_section_incremental_inputs::do_write): Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE. --- diff --git a/gold/ChangeLog b/gold/ChangeLog index 3ccaf58f140..4a2f7457c97 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,5 +1,11 @@ 2012-11-07 Roland McGrath + * dwarf_reader.cc (Sized_elf_reloc_mapper::symbol_section): Cast + SYMNDX to off_t before comparing it to this->data_size(). + * output.cc (Output_symtab_xindex::endian_do_write): Likewise. + * incremental.cc (Output_section_incremental_inputs::do_write): + Cast GLOBAL_SYM_COUNT to off_t before comparing it to SYMTAB_SIZE. + * nacl.cc: Include "libiberty.h" for vasprintf declaration. 2012-11-05 Alan Modra diff --git a/gold/dwarf_reader.cc b/gold/dwarf_reader.cc index ac87f4b843d..561d0ae55f1 100644 --- a/gold/dwarf_reader.cc +++ b/gold/dwarf_reader.cc @@ -58,7 +58,7 @@ Sized_elf_reloc_mapper::symbol_section( unsigned int symndx, Address* value, bool* is_ordinary) { const int symsize = elfcpp::Elf_sizes::sym_size; - gold_assert((symndx + 1) * symsize <= this->symtab_size_); + gold_assert(static_cast((symndx + 1) * symsize) <= this->symtab_size_); elfcpp::Sym elfsym(this->symtab_ + symndx * symsize); *value = elfsym.get_st_value(); return this->object_->adjust_sym_shndx(symndx, elfsym.get_st_shndx(), @@ -508,7 +508,7 @@ Dwarf_pubnames_table::read_header(off_t offset) pinfo += 2; if (version != 2) return false; - + // Skip the debug_info_offset and debug_info_size fields. pinfo += 2 * this->offset_size_; diff --git a/gold/incremental.cc b/gold/incremental.cc index acabaea950e..714b1985c76 100644 --- a/gold/incremental.cc +++ b/gold/incremental.cc @@ -1432,7 +1432,7 @@ Output_section_incremental_inputs::do_write(Output_file* of) gold_assert(pov - oview == oview_size); // Write the .gnu_incremental_symtab section. - gold_assert(global_sym_count * 4 == symtab_size); + gold_assert(static_cast(global_sym_count) * 4 == symtab_size); this->write_symtab(symtab_view, global_syms, global_sym_count); delete[] global_syms; diff --git a/gold/output.cc b/gold/output.cc index 99890ebae1e..624009191a6 100644 --- a/gold/output.cc +++ b/gold/output.cc @@ -1876,7 +1876,7 @@ Output_symtab_xindex::endian_do_write(unsigned char* const oview) ++p) { unsigned int symndx = p->first; - gold_assert(symndx * 4 < this->data_size()); + gold_assert(static_cast(symndx) * 4 < this->data_size()); elfcpp::Swap<32, big_endian>::writeval(oview + symndx * 4, p->second); } } @@ -2703,7 +2703,7 @@ Output_section::convert_input_sections_in_list_to_relaxed_sections( (*input_sections)[p->second].set_section_order_index(soi); } } - + // Convert regular input sections into relaxed input sections. RELAXED_SECTIONS // is a vector of pointers to Output_relaxed_input_section or its derived // classes. The relaxed sections must correspond to existing input sections. @@ -2718,7 +2718,7 @@ Output_section::convert_input_sections_to_relaxed_sections( // this. If there is no checkpoint active, just search the current // input section list and replace the sections there. If there is // a checkpoint, also replace the sections there. - + // By default, we look at the whole list. size_t limit = this->input_sections_.size(); @@ -2831,13 +2831,13 @@ Output_section::build_lookup_maps() const for (Output_merge_base::Input_sections::const_iterator is = pomb->input_sections_begin(); is != pomb->input_sections_end(); - ++is) + ++is) { const Const_section_id& csid = *is; this->lookup_maps_->add_merge_input_section(csid.first, csid.second, pomb); } - + } else if (p->is_relaxed_input_section()) { @@ -2879,7 +2879,7 @@ Output_section::is_input_address_mapped(const Relobj* object, { section_offset_type output_offset; bool found = posd->output_offset(object, shndx, offset, &output_offset); - gold_assert(found); + gold_assert(found); return output_offset != -1; } @@ -2914,13 +2914,13 @@ Output_section::output_offset(const Relobj* object, unsigned int shndx, // Look at the Output_section_data_maps first. const Output_section_data* posd = this->find_merge_section(object, shndx); - if (posd == NULL) + if (posd == NULL) posd = this->find_relaxed_input_section(object, shndx); if (posd != NULL) { section_offset_type output_offset; bool found = posd->output_offset(object, shndx, offset, &output_offset); - gold_assert(found); + gold_assert(found); return output_offset; } @@ -2947,7 +2947,7 @@ Output_section::output_address(const Relobj* object, unsigned int shndx, // Look at the Output_section_data_maps first. const Output_section_data* posd = this->find_merge_section(object, shndx); - if (posd == NULL) + if (posd == NULL) posd = this->find_relaxed_input_section(object, shndx); if (posd != NULL && posd->is_address_valid()) { @@ -3433,7 +3433,7 @@ Output_section::Input_section_sort_section_order_index_compare::operator()( // Keep input order if section ordering cannot determine order. if (s1_secn_index == s2_secn_index) return s1.index() < s2.index(); - + return s1_secn_index < s2_secn_index; } @@ -3796,7 +3796,7 @@ Output_section::add_script_input_section(const Input_section& sis) this->input_sections_.push_back(sis); - // Update fast lookup maps if necessary. + // Update fast lookup maps if necessary. if (this->lookup_maps_->is_valid()) { if (sis.is_merge_section()) @@ -4110,7 +4110,7 @@ Output_segment::maximum_alignment() if (!this->is_max_align_known_) { for (int i = 0; i < static_cast(ORDER_MAX); ++i) - { + { const Output_data_list* pdl = &this->output_lists_[i]; uint64_t addralign = Output_segment::maximum_alignment_list(pdl); if (addralign > this->max_align_)