aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-bfd.h
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-12-18 18:33:14 +1030
committerAlan Modra <amodra@gmail.com>2019-12-18 18:38:13 +1030
commit2365f8d70c50afbfd6be69a4076ea6e78fb5485d (patch)
treefbb92f4ec54f3a4fb3efdff76ca0a248f6faf121 /bfd/elf-bfd.h
parent2480b6fa946bb2d2dc993b1c4a83a8e1258a75e8 (diff)
downloadgdb-2365f8d70c50afbfd6be69a4076ea6e78fb5485d.zip
gdb-2365f8d70c50afbfd6be69a4076ea6e78fb5485d.tar.gz
gdb-2365f8d70c50afbfd6be69a4076ea6e78fb5485d.tar.bz2
Yet more signed overflow fixes
* elf-bfd.h (ELF_LOCAL_SYMBOL_HASH): Avoid signed overflow. * elf32-hppa.c (final_link_relocate): Likewise. * elf32-ppc.c (_bfd_elf_ppc_at_tls_transform): Likewise. (_bfd_elf_ppc_at_tprel_transform, is_insn_ds_form): Likewise. (is_insn_dq_form, ppc_elf_relocate_section): Likewise. * elf64-ppc.c (ok_lo_toc_insn, ppc64_elf_edit_toc): Likewise. (ppc64_elf_relocate_section): Likewise. * elfxx-mips.c (mips_elf_perform_relocation): Likewise. * netbsd.h (N_SET_FLAGS): Likewise.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r--bfd/elf-bfd.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 6cfd1ac..2db6fcd 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -2836,8 +2836,8 @@ extern asection _bfd_elf_large_com_section;
/* Hash for local symbol with the first section id, ID, in the input
file and the local symbol index, SYM. */
#define ELF_LOCAL_SYMBOL_HASH(ID, SYM) \
- (((((ID) & 0xff) << 24) | (((ID) & 0xff00) << 8)) \
- ^ (SYM) ^ ((ID) >> 16))
+ (((((ID) & 0xffU) << 24) | (((ID) & 0xff00) << 8)) \
+ ^ (SYM) ^ (((ID) & 0xffff0000U) >> 16))
/* This is the condition under which finish_dynamic_symbol will be called.
If our finish_dynamic_symbol isn't called, we'll need to do something