summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorqiuyiuestc <[email protected]>2010-12-13 14:17:00 +0000
committerqiuyiuestc <[email protected]>2010-12-13 14:17:00 +0000
commit179bdeca6c25c2200b5f497f29acf0562ed65b36 (patch)
tree64d55c32a176637eeebb5475b933cfc86cae7d63 /src
parent12750c38b88533feb5538396c81769ac7ae037f1 (diff)
update elf loader
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1200 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'src')
-rw-r--r--src/module.c8
-rw-r--r--src/rtm.c3
2 files changed, 9 insertions, 2 deletions
diff --git a/src/module.c b/src/module.c
index 23d1eae8f4..b42c39defd 100644
--- a/src/module.c
+++ b/src/module.c
@@ -163,7 +163,11 @@ static int rt_module_arm_relocate(struct rt_module* module, Elf32_Rel *rel, Elf3
rt_kprintf("R_ARM_JUMP_SLOT: 0x%x -> 0x%x 0x%x\n", where, *where, sym_val);
#endif
break;
- case R_ARM_RELATIVE:
+ case R_ARM_RELATIVE:
+ *where += (Elf32_Addr)sym_val;
+#ifdef RT_MODULE_DEBUG
+ rt_kprintf("R_ARM_RELATIVE: 0x%x -> 0x%x 0x%x\n", where, *where, sym_val);
+#endif
break;
default:
return -1;
@@ -339,7 +343,7 @@ rt_module_t rt_module_load(const rt_uint8_t* name, void* module_ptr)
#ifdef RT_MODULE_DEBUG
rt_kprintf("relocate symbol %s shndx %d\n", strtab + sym->st_name, sym->st_shndx);
#endif
- if(sym->st_shndx != SHT_NULL || ELF_ST_TYPE(sym->st_info) == STB_LOCAL )
+ if((sym->st_shndx != SHT_NULL) || (ELF_ST_BIND(sym->st_info) == STB_LOCAL))
{
rt_module_arm_relocate(
module,
diff --git a/src/rtm.c b/src/rtm.c
index 2143f58bb3..70f86facb8 100644
--- a/src/rtm.c
+++ b/src/rtm.c
@@ -154,6 +154,7 @@ RTM_EXPORT(rt_sprintf)
/*
* misc interface symbol
*/
+extern int __aeabi_idiv;
extern int __aeabi_ddiv;
extern int __aeabi_dmul;
extern int __aeabi_i2d;
@@ -165,10 +166,12 @@ RTM_EXPORT(__aeabi_ddiv)
RTM_EXPORT(__aeabi_dmul)
RTM_EXPORT(__aeabi_i2d)
RTM_EXPORT(__aeabi_uidiv)
+RTM_EXPORT(__aeabi_idiv)
RTM_EXPORT(__aeabi_uidivmod)
RTM_EXPORT(__aeabi_d2iz)
RTM_EXPORT(strcmp)
RTM_EXPORT(rand)
+RTM_EXPORT(memset)
#ifdef RT_USING_NEWLIB