wamrc: Fix windows relocation to aot_func_internal#n (#2474)
AOT relocation to aot_func_internal#n is generated by wamrc --bounds-checks=1. Resolve the issue by applying the relocation in the compilation stage by wamrc and don't generate these relocations in the AOT file. Fixes #2471.
This commit is contained in:
@ -164,6 +164,9 @@ apply_relocation(AOTModule *module, uint8 *target_section_addr,
|
||||
(uint32)((uintptr_t)symbol_addr + (intptr_t)reloc_addend
|
||||
- (uintptr_t)(target_section_addr
|
||||
+ (uint32)reloc_offset)
|
||||
#if defined(BH_PLATFORM_WINDOWS)
|
||||
- sizeof(int32)
|
||||
#endif
|
||||
+ value); /* S + A - P */
|
||||
break;
|
||||
}
|
||||
|
||||
@ -242,7 +242,7 @@ apply_relocation(AOTModule *module, uint8 *target_section_addr,
|
||||
- (uintptr_t)(target_section_addr + reloc_offset));
|
||||
}
|
||||
else {
|
||||
target_addr = (intptr_t) /* L + A - P */
|
||||
target_addr = (intptr_t) /* S + A - P */
|
||||
((uintptr_t)symbol_addr + reloc_addend
|
||||
- (uintptr_t)(target_section_addr + reloc_offset));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user