mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2024-10-16 21:12:20 +00:00
aot_reloc_arm.c: Implement R_ARM_MOVW_ABS_NC and R_ARM_MOVT_ABS (#1148)
Implement reloc type R_ARM_MOVW_ABS_NC and R_ARM_MOVT_ABS for arm, refer to: https://github.com/ARM-software/abi-aa/blob/main/aaelf32/aaelf32.rst#5614static-arm-relocations
This commit is contained in:
parent
8db6f5978b
commit
3edb832f76
|
@ -8,6 +8,8 @@
|
|||
#define R_ARM_CALL 28 /* PC relative 24 bit (BL, BLX). */
|
||||
#define R_ARM_JMP24 29 /* PC relative 24 bit (B/BL<cond>). */
|
||||
#define R_ARM_ABS32 2 /* Direct 32 bit */
|
||||
#define R_ARM_MOVW_ABS_NC 43
|
||||
#define R_ARM_MOVT_ABS 44
|
||||
|
||||
/* clang-format off */
|
||||
void __adddf3();
|
||||
|
@ -339,6 +341,21 @@ apply_relocation(AOTModule *module, uint8 *target_section_addr,
|
|||
+ (intptr_t)reloc_addend;
|
||||
break;
|
||||
}
|
||||
case R_ARM_MOVW_ABS_NC:
|
||||
case R_ARM_MOVT_ABS:
|
||||
{
|
||||
uintptr_t *loc;
|
||||
uintptr_t addr;
|
||||
CHECK_RELOC_OFFSET(sizeof(void *));
|
||||
loc = (uintptr_t *)(target_section_addr + (uint32)reloc_offset);
|
||||
addr = (uintptr_t)symbol_addr + (intptr_t)reloc_addend;
|
||||
if (reloc_type == R_ARM_MOVT_ABS) {
|
||||
addr >>= 16;
|
||||
}
|
||||
*loc = ((*loc) & 0xfff0f000) | ((addr << 4) & 0x000f0000)
|
||||
| (addr & 0x00000fff);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
if (error_buf != NULL)
|
||||
|
|
Loading…
Reference in New Issue
Block a user