diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2012-11-01 21:10:59 -0700 |
---|---|---|
committer | Andrew Hsieh <andrewhsieh@google.com> | 2012-11-01 23:16:47 -0700 |
commit | c898b73f6471a17e908c56becb8c102cf447d639 (patch) | |
tree | 2d13379351b0604ce692b592482abbb47e585910 | |
parent | 6d5ce99288a663253fd2cde30516257f754cc776 (diff) | |
download | toolchain_binutils-c898b73f6471a17e908c56becb8c102cf447d639.tar.gz toolchain_binutils-c898b73f6471a17e908c56becb8c102cf447d639.tar.bz2 toolchain_binutils-c898b73f6471a17e908c56becb8c102cf447d639.zip |
[2.22.90] Fix binutils-2.22/gold build in mingw
Modified two more files (nacl.cc and dwarf_reader.cc)
then previous commit c4e152d03f30998de6c625c45d894e8ce1c812c7
this change is based.
Change-Id: Ie6276194ceac69fc6dc6741c5905687373d2fac4
-rw-r--r-- | binutils-2.22/gold/arm.cc | 6 | ||||
-rw-r--r-- | binutils-2.22/gold/descriptors.cc | 2 | ||||
-rw-r--r-- | binutils-2.22/gold/dwarf_reader.cc | 2 | ||||
-rw-r--r-- | binutils-2.22/gold/incremental.cc | 2 | ||||
-rw-r--r-- | binutils-2.22/gold/nacl.cc | 1 | ||||
-rw-r--r-- | binutils-2.22/gold/output.cc | 2 |
6 files changed, 9 insertions, 6 deletions
diff --git a/binutils-2.22/gold/arm.cc b/binutils-2.22/gold/arm.cc index fa257a79..c93331c5 100644 --- a/binutils-2.22/gold/arm.cc +++ b/binutils-2.22/gold/arm.cc @@ -9683,7 +9683,7 @@ Target_arm<big_endian>::relocate_special_relocatable( Arm_address offset = reloc.get_r_offset(); Arm_address new_offset; - if (offset_in_output_section != invalid_address) + if (offset_in_output_section != static_cast<off_t>(invalid_address)) new_offset = offset + offset_in_output_section; else { @@ -9702,8 +9702,8 @@ Target_arm<big_endian>::relocate_special_relocatable( if (!parameters->options().relocatable()) { new_offset += view_address; - if (offset_in_output_section != invalid_address) - new_offset -= offset_in_output_section; + if (offset_in_output_section != static_cast<off_t>(invalid_address)) + new_offset -= offset_in_output_section; } reloc_write.put_r_offset(new_offset); diff --git a/binutils-2.22/gold/descriptors.cc b/binutils-2.22/gold/descriptors.cc index 2ab0d5c8..63b4cf9f 100644 --- a/binutils-2.22/gold/descriptors.cc +++ b/binutils-2.22/gold/descriptors.cc @@ -50,6 +50,8 @@ set_close_on_exec(int fd) // Mingw does not define F_SETFD. #ifdef F_SETFD fcntl(fd, F_SETFD, FD_CLOEXEC); +#else + (void)fd; #endif } diff --git a/binutils-2.22/gold/dwarf_reader.cc b/binutils-2.22/gold/dwarf_reader.cc index ac87f4b8..616b0816 100644 --- a/binutils-2.22/gold/dwarf_reader.cc +++ b/binutils-2.22/gold/dwarf_reader.cc @@ -58,7 +58,7 @@ Sized_elf_reloc_mapper<size, big_endian>::symbol_section( unsigned int symndx, Address* value, bool* is_ordinary) { const int symsize = elfcpp::Elf_sizes<size>::sym_size; - gold_assert((symndx + 1) * symsize <= this->symtab_size_); + gold_assert(static_cast<off_t>((symndx + 1) * symsize) <= this->symtab_size_); elfcpp::Sym<size, big_endian> elfsym(this->symtab_ + symndx * symsize); *value = elfsym.get_st_value(); return this->object_->adjust_sym_shndx(symndx, elfsym.get_st_shndx(), diff --git a/binutils-2.22/gold/incremental.cc b/binutils-2.22/gold/incremental.cc index acabaea9..18031e34 100644 --- a/binutils-2.22/gold/incremental.cc +++ b/binutils-2.22/gold/incremental.cc @@ -1432,7 +1432,7 @@ Output_section_incremental_inputs<size, big_endian>::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<off_t>(global_sym_count) * 4 == symtab_size); this->write_symtab(symtab_view, global_syms, global_sym_count); delete[] global_syms; diff --git a/binutils-2.22/gold/nacl.cc b/binutils-2.22/gold/nacl.cc index 71be4e93..cc05a204 100644 --- a/binutils-2.22/gold/nacl.cc +++ b/binutils-2.22/gold/nacl.cc @@ -25,6 +25,7 @@ #include "nacl.h" #include "elfcpp.h" +#include "libiberty.h" namespace gold { diff --git a/binutils-2.22/gold/output.cc b/binutils-2.22/gold/output.cc index 99890eba..aceee1bf 100644 --- a/binutils-2.22/gold/output.cc +++ b/binutils-2.22/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<off_t>(symndx * 4) < this->data_size()); elfcpp::Swap<32, big_endian>::writeval(oview + symndx * 4, p->second); } } |