This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH bfd arm] Fix mismatch to EABI in misaligned R_ARM_THM_PC8
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Joey Ye <joey dot ye at arm dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Fri, 19 Oct 2012 17:38:39 +0100
- Subject: Re: [PATCH bfd arm] Fix mismatch to EABI in misaligned R_ARM_THM_PC8
- References: <000201cdae0a$38886020$a9992060$@firstname.lastname@example.org>
On 19/10/12 15:58, Joey Ye wrote:
This patch implement relocation operation according to ARM EABI section
and 188.8.131.52. Trunk binutils malfunctions when linking objection files
non-4-byte aligned location with R_ARM_THM_PC8 type.
Original bfd missed following two EABI updates, as extracted from aaelf
184.108.40.206 Addends and PC-bias compensation
For R_ARM_THM_PC8 the initial addend is formed by the formula (((imm + 4) &
0x3ff) - 4), where imm is the normal interpretation of the immediate field
in a Thumb LDR(3)/LDR(lliteral) instruction.
Pa is the adjusted address of the place being relocated, defined as (P &
R_ARM_THM_PC8: S + A - Pa
R_ARM_THM_ALU_PREL_11_0: ((S + A) | T) - Pa
R_ARM_THM_PC12: S + A - Pa
Test case not available since GAS doesn't generate these types of
OK to trunk and 2.21/2.22?
2012-10-19 Joey Ye <email@example.com>
* 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.