From: Yufeng Zhang Date: Mon, 19 Nov 2012 18:46:03 +0000 (+0000) Subject: bfd/ChangeLog X-Git-Tag: binutils-2_23_2~183 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a51c6ecafe3893cefe304ccd5d86889e3ad751b5;p=thirdparty%2Fbinutils-gdb.git bfd/ChangeLog 2012-11-19 Joey Ye * elf32-arm.c (elf32_arm_final_link_relocate, case R_ARM_THM_ALU_PREL_11_0, case R_ARM_THM_PC12): Align address of the place being relocated. (elf32_arm_final_link_relocate, case R_ARM_THM_PC8): Align address of the place being relocated and truncate addend. (Pa): New macro. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 981e05a2b74..59c36a77849 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,12 @@ +2012-11-19 Joey Ye + + * elf32-arm.c (elf32_arm_final_link_relocate, + case R_ARM_THM_ALU_PREL_11_0, case R_ARM_THM_PC12): Align address of + the place being relocated. + (elf32_arm_final_link_relocate, case R_ARM_THM_PC8): Align address + of the place being relocated and truncate addend. + (Pa): New macro. + 2012-11-14 Roland McGrath * elf32-arm.c (elf32_arm_nacl_plt0_entry): Use bic rather than bfc diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index 3c541ca9ef2..01ca11b1547 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -63,6 +63,9 @@ #define ARM_ELF_ABI_VERSION 0 #define ARM_ELF_OS_ABI_VERSION ELFOSABI_ARM +/* The Adjusted Place, as defined by AAELF. */ +#define Pa(X) ((X) & 0xfffffffc) + static bfd_boolean elf32_arm_write_section (bfd *output_bfd, struct bfd_link_info *link_info, asection *sec, @@ -8619,9 +8622,9 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, } relocation = value + signed_addend; - relocation -= (input_section->output_section->vma - + input_section->output_offset - + rel->r_offset); + relocation -= Pa (input_section->output_section->vma + + input_section->output_offset + + rel->r_offset); value = abs (relocation); @@ -8651,12 +8654,12 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, insn = bfd_get_16 (input_bfd, hit_data); if (globals->use_rel) - addend = (insn & 0x00ff) << 2; + addend = ((((insn & 0x00ff) << 2) + 4) & 0x3ff) -4; relocation = value + addend; - relocation -= (input_section->output_section->vma - + input_section->output_offset - + rel->r_offset); + relocation -= Pa (input_section->output_section->vma + + input_section->output_offset + + rel->r_offset); value = abs (relocation); @@ -8691,9 +8694,9 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto, } relocation = value + signed_addend; - relocation -= (input_section->output_section->vma - + input_section->output_offset - + rel->r_offset); + relocation -= Pa (input_section->output_section->vma + + input_section->output_offset + + rel->r_offset); value = abs (relocation);