From 1e269e9b8fb2acf403bfa09486cdc5d496bbf27b Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 20 Nov 2014 21:07:58 +1030 Subject: [PATCH] ppc476 workaround sizing * elf32-ppc.c (ppc_elf_relax_section): Correct ppc476 workaround alignment calculation. --- bfd/ChangeLog | 5 +++++ bfd/elf32-ppc.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index eaf7a99b4fa..fb9de4ad0bc 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2014-11-20 Alan Modra + + * elf32-ppc.c (ppc_elf_relax_section): Correct ppc476 workaround + alignment calculation. + 2014-11-20 Terry Guo * elf32-arm.c (elf32_arm_merge_eabi_attributes): Skip if input bfd diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c index 04c2d6ad60b..b4d20753cf7 100644 --- a/bfd/elf32-ppc.c +++ b/bfd/elf32-ppc.c @@ -7174,7 +7174,7 @@ ppc_elf_relax_section (bfd *abfd, /* Keep space aligned, to ensure the patch code itself does not cross a page. Don't decrease size calculated on a previous pass as otherwise we might never settle on a layout. */ - newsize = 15 - (end_addr & 15); + newsize = 15 - ((end_addr - 1) & 15); newsize += crossings * 16; if (relax_info->workaround_size < newsize) { -- 2.30.2