Skip to content

Commit 9d0cb6d

Browse files
ChenMiaoistffrdhrn
authored andcommitted
openrisc: Add R_OR1K_32_PCREL relocation type module support
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 <[email protected]> Signed-off-by: Stafford Horne <[email protected]>
1 parent 4735037 commit 9d0cb6d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/openrisc/kernel/module.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
5555
value |= *location & 0xfc000000;
5656
*location = value;
5757
break;
58+
case R_OR1K_32_PCREL:
59+
value -= (uint32_t)location;
60+
*location = value;
61+
break;
5862
case R_OR1K_AHI16:
5963
/* Adjust the operand to match with a signed LO16. */
6064
value += 0x8000;

0 commit comments

Comments
 (0)