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; }
This commit is contained in:
parent
84a44e58dd
commit
74622c6ed3
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue