summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2018-02-12 16:39:05 +0800
committerGitHub <[email protected]>2018-02-12 16:39:05 +0800
commita692cc1549cabe75d86ad308be8ad5d90e4b34a4 (patch)
tree80b104a8c49dcf864ff4ac74618a4768ef2cd4fc /src
parent76a0cc9b585c41de26d33c6c1d750377ed31c5bc (diff)
parent74622c6ed343b0fffe6ce47b620569f0d94ceee4 (diff)
Merge pull request #1215 from parai/patch-1
Fix issue when loading *.o when do internal function call
Diffstat (limited to 'src')
-rw-r--r--src/module.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/module.c b/src/module.c
index 2c5cec1b01..b9801558dc 100644
--- a/src/module.c
+++ b/src/module.c
@@ -823,6 +823,15 @@ static struct rt_module* _load_relocated_object(const char *name,
(Elf32_Addr)data_addr + sym->st_value);
}
}
+ else if (ELF_ST_TYPE(sym->st_info) == STT_FUNC)
+ {
+ /* relocate function */
+ rt_module_arm_relocate(module, rel,
+ (Elf32_Addr)((rt_uint8_t *)
+ module->module_space
+ - module_addr
+ + sym->st_value));
+ }
}
else if (ELF_ST_TYPE(sym->st_info) == STT_FUNC)
{