This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH bfd arm] Fix mismatch to EABI in misaligned R_ARM_THM_PC8

On 19/10/12 15:58, Joey Ye wrote:
This patch implement relocation operation according to ARM EABI section
and  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
*** 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 <>

	* 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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]