mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-12-22 10:40:43 +01:00
openrisc: Add R_OR1K_32_PCREL relocation type module support
[ Upstream commit 9d0cb6d00b ]
To ensure the proper functioning of the jump_label test module, this patch
adds support for the R_OR1K_32_PCREL relocation type for any modules. The
implementation calculates the PC-relative offset by subtracting the
instruction location from the target value and stores the result at the
specified location.
Signed-off-by: chenmiao <chenmiao.ku@gmail.com>
Signed-off-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
317d3bbc22
commit
483886e1f7
|
|
@ -55,6 +55,10 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
|
|||
value |= *location & 0xfc000000;
|
||||
*location = value;
|
||||
break;
|
||||
case R_OR1K_32_PCREL:
|
||||
value -= (uint32_t)location;
|
||||
*location = value;
|
||||
break;
|
||||
case R_OR1K_AHI16:
|
||||
/* Adjust the operand to match with a signed LO16. */
|
||||
value += 0x8000;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user