summaryrefslogtreecommitdiff
path: root/src/module.c
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/module.c
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/module.c')
-rw-r--r--src/module.c8
1 files changed, 6 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,