mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-11-09 20:45:41 +08:00
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:
1 parent
84a44e58dd
commit
74622c6ed3
1 file changed
+9
@@ -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)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user