diff options
author | Alan Modra <amodra@gmail.com> | 2019-03-28 16:53:32 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2019-03-28 17:10:31 +1030 |
commit | 242a115951fe55e62036bac555017eb817ca1aa6 (patch) | |
tree | c7e676c00296cd37ed77da28fa4b43d43e835887 /bfd/mach-o.c | |
parent | 96a86c01d119372f4af5aff2501d3104e6c1a8e3 (diff) | |
download | gdb-242a115951fe55e62036bac555017eb817ca1aa6.zip gdb-242a115951fe55e62036bac555017eb817ca1aa6.tar.gz gdb-242a115951fe55e62036bac555017eb817ca1aa6.tar.bz2 |
PR24392, Clang warning Wtautological-constant-out-of-range-compare
PR 24392
* configure.ac: Invoke AC_CHECK_SIZEOF(int).
* configure: Regenerate.
* coffgen.c (coff_get_reloc_upper_bound): Replace gcc diagnostic
workaround with SIZEOF_LONG vs. SIZEOF_INT check.
* elf.c (_bfd_elf_get_reloc_upper_bound): Likewise.
* elf64-sparc.c (elf64_sparc_get_reloc_upper_bound): Likewise.
* mach-o.c (bfd_mach_o_get_reloc_upper_bound): Likewise.
Diffstat (limited to 'bfd/mach-o.c')
-rw-r--r-- | bfd/mach-o.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/bfd/mach-o.c b/bfd/mach-o.c index a9ca313..122a0c2 100644 --- a/bfd/mach-o.c +++ b/bfd/mach-o.c @@ -1417,24 +1417,19 @@ bfd_mach_o_write_dyld_info (bfd *abfd, bfd_mach_o_load_command *command) return TRUE; } -#if GCC_VERSION >= 4003 -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wtype-limits" -#endif long bfd_mach_o_get_reloc_upper_bound (bfd *abfd ATTRIBUTE_UNUSED, asection *asect) { +#if SIZEOF_LONG == SIZEOF_INT if (asect->reloc_count >= LONG_MAX / sizeof (arelent *)) { bfd_set_error (bfd_error_file_too_big); return -1; } +#endif return (asect->reloc_count + 1) * sizeof (arelent *); } -#if GCC_VERSION >= 4003 -# pragma GCC diagnostic pop -#endif /* In addition to the need to byte-swap the symbol number, the bit positions of the fields in the relocation information vary per target endian-ness. */ |