diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2012-10-03 20:10:39 +0800 |
---|---|---|
committer | Andrew Hsieh <andrewhsieh@google.com> | 2012-10-03 20:21:32 +0800 |
commit | c4e152d03f30998de6c625c45d894e8ce1c812c7 (patch) | |
tree | 1f8f920688ecdf22eeabdd0fc3f31cbdcbb75fbd | |
parent | 175055c1722d53d47fdd777f9bc769ab434b9402 (diff) | |
download | toolchain_binutils-c4e152d03f30998de6c625c45d894e8ce1c812c7.tar.gz toolchain_binutils-c4e152d03f30998de6c625c45d894e8ce1c812c7.tar.bz2 toolchain_binutils-c4e152d03f30998de6c625c45d894e8ce1c812c7.zip |
Fix binutils-2.22/gold build in mingw
1) Fix unused variable warning treated as an error,
partial backport of 28c6758c7a87647eec5476a5c03415b121b44c7a
done to binutils-2.21/gold
2) Add casts where i586-mingw32msvc-gcc gives warnings
later treated as errors, same as
68ba60c0e44c1187cb582474ebb001d95a7170f6 done to
binutils-2.21/gold
Change-Id: I746477ebef77159d340178d20c9ec4e2dca23abc
-rw-r--r-- | binutils-2.22/gold/arm.cc | 4 | ||||
-rw-r--r-- | binutils-2.22/gold/descriptors.cc | 2 | ||||
-rw-r--r-- | binutils-2.22/gold/incremental.cc | 2 | ||||
-rw-r--r-- | binutils-2.22/gold/output.cc | 2 |
4 files changed, 6 insertions, 4 deletions
diff --git a/binutils-2.22/gold/arm.cc b/binutils-2.22/gold/arm.cc index 72c3670d..e31bb60c 100644 --- a/binutils-2.22/gold/arm.cc +++ b/binutils-2.22/gold/arm.cc @@ -9646,7 +9646,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 { @@ -9665,7 +9665,7 @@ Target_arm<big_endian>::relocate_special_relocatable( if (!parameters->options().relocatable()) { new_offset += view_address; - if (offset_in_output_section != invalid_address) + if (offset_in_output_section != static_cast<off_t>(invalid_address)) new_offset -= offset_in_output_section; } 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/incremental.cc b/binutils-2.22/gold/incremental.cc index b422827e..90281f9b 100644 --- a/binutils-2.22/gold/incremental.cc +++ b/binutils-2.22/gold/incremental.cc @@ -1411,7 +1411,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/output.cc b/binutils-2.22/gold/output.cc index 29d8e3d5..34947d95 100644 --- a/binutils-2.22/gold/output.cc +++ b/binutils-2.22/gold/output.cc @@ -1922,7 +1922,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); } } |