Sync with internal feature (#204)

This commit is contained in:
wenyongh
2020-03-18 17:49:23 +08:00
committed by GitHub
parent 6523868a9a
commit c6042c45a3
8 changed files with 65 additions and 21 deletions

View File

@ -149,19 +149,22 @@ apply_relocation(AOTModule *module,
}
case R_X86_64_PLT32:
{
uint8 *plt = (uint8*)module->code + module->code_size - get_plt_table_size()
+ get_plt_item_size() * symbol_index;
intptr_t target_addr = (intptr_t) /* L + A - P */
(plt + reloc_addend
- (target_section_addr + reloc_offset));
uint8 *plt;
intptr_t target_addr = 0;
CHECK_RELOC_OFFSET(sizeof(int32));
if (symbol_index < 0) {
set_error_buf(error_buf, error_buf_size,
"AOT module load failed: "
"invalid symbol index for relocation");
return false;
if (symbol_index >= 0) {
plt = (uint8*)module->code + module->code_size - get_plt_table_size()
+ get_plt_item_size() * symbol_index;
target_addr = (intptr_t) /* L + A - P */
(plt + reloc_addend
- (target_section_addr + reloc_offset));
}
else {
target_addr = (intptr_t) /* L + A - P */
((uint8*)symbol_addr + reloc_addend
- (target_section_addr + reloc_offset));
}
if ((int32)target_addr != target_addr) {