aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-ppc.c
diff options
context:
space:
mode:
authorDominik Vogt <vogt@linux.vnet.ibm.com>2015-11-09 17:12:56 +0100
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>2015-11-09 17:12:56 +0100
commit29f628db8835fd86b85ffb40d4a9ed5b1c28f1e6 (patch)
treec0ffbc644152f866b50a138946114840e09b4612 /bfd/elf64-ppc.c
parenta5eda10c7857581e6ee641937f99aa76fa8044eb (diff)
downloadgdb-29f628db8835fd86b85ffb40d4a9ed5b1c28f1e6.zip
gdb-29f628db8835fd86b85ffb40d4a9ed5b1c28f1e6.tar.gz
gdb-29f628db8835fd86b85ffb40d4a9ed5b1c28f1e6.tar.bz2
bfd: Fix left shift of negative value.
This patch fixes all occurences of left-shifting negative constants in C code which is undefined by the C standard. bfd/ChangeLog: * elf64-ppc.c (ppc64_elf_size_stubs, ppc64_elf_build_stubs): Fix left shift of negative value. * libbfd.c (safe_read_leb128): Likewise. * dwarf2.c (place_sections): Likewise. * bfd-in.h (align_power): Likewise. * bfd-in2.h (align_power): Likewise.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r--bfd/elf64-ppc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index cda8e59..0a85ab8 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -12497,7 +12497,7 @@ ppc64_elf_size_stubs (struct bfd_link_info *info)
if ((stub_sec->flags & SEC_LINKER_CREATED) == 0)
stub_sec->size = ((stub_sec->size
+ (1 << htab->params->plt_stub_align) - 1)
- & (-1 << htab->params->plt_stub_align));
+ & -(1 << htab->params->plt_stub_align));
for (stub_sec = htab->params->stub_bfd->sections;
stub_sec != NULL;
@@ -13021,7 +13021,7 @@ ppc64_elf_build_stubs (struct bfd_link_info *info,
if ((stub_sec->flags & SEC_LINKER_CREATED) == 0)
stub_sec->size = ((stub_sec->size
+ (1 << htab->params->plt_stub_align) - 1)
- & (-1 << htab->params->plt_stub_align));
+ & -(1 << htab->params->plt_stub_align));
for (stub_sec = htab->params->stub_bfd->sections;
stub_sec != NULL;