diff options
| author | parai <[email protected]> | 2018-02-08 20:19:10 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-02-08 20:19:10 +0800 |
| commit | 74622c6ed343b0fffe6ce47b620569f0d94ceee4 (patch) | |
| tree | 75a490f309f65667020e11ed22f5ede6dad3b59b /src | |
| parent | 84a44e58ddcd57d12c3a1dcbff17ff9d96b2cd41 (diff) | |
Fix issue when loading *.o when do internal function call
Fox example for the below example code:
#include <stdio.h>
void goodBye(void)
{
printf("Good Bye!\n");
}
int main(int argc, char* argv[])
{
printf("Hello World!\n");
goodBye();
return 0;
}
Diffstat (limited to 'src')
| -rw-r--r-- | src/module.c | 9 |
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) { |
