summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author[email protected] <[email protected]>2012-04-13 14:06:33 +0000
committer[email protected] <[email protected]>2012-04-13 14:06:33 +0000
commitffa1c57e10f430bd58042cf930e599e22a2cbb71 (patch)
treecec913027fe76f2f8713c7e5e3ba452d59b33ab9 /src
parenta7810e12b9c2769419bac6582fae079d15ab9366 (diff)
eliminate compile warning in module.c
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2037 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'src')
-rw-r--r--src/module.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/module.c b/src/module.c
index e4740dcf90..19771137a5 100644
--- a/src/module.c
+++ b/src/module.c
@@ -468,19 +468,6 @@ static struct rt_module* _load_shared_object(const char *name, void *module_ptr)
}
}
-#if 0
- for (index = 0; index < elf_module->e_shnum; index ++)
- {
- /* find .dynsym section */
- rt_uint8_t* shstrab = (rt_uint8_t*) module_ptr + shdr[elf_module->e_shstrndx].sh_offset;
- if (rt_strcmp((const char *)(shstrab + shdr[index].sh_name), ELF_GOT) == 0)
- {
- rt_hw_set_got_base(module->module_space + shdr[index].sh_offset);
- break;
- }
- }
-#endif
-
/* construct module symbol table */
for (index = 0; index < elf_module->e_shnum; index ++)
{
@@ -664,13 +651,13 @@ static struct rt_module* _load_relocated_object(const char *name, void *module_p
RT_DEBUG_LOG(RT_DEBUG_MODULE,("rodata\n"));
rt_module_arm_relocate(module, rel,(Elf32_Addr)(rodata_addr + sym->st_value));
}
- else if(strncmp(shstrab + shdr[sym->st_shndx].sh_name, ELF_BSS, 5) == 0)
+ else if(rt_strncmp(shstrab + shdr[sym->st_shndx].sh_name, ELF_BSS, 5) == 0)
{
/* relocate bss section */
RT_DEBUG_LOG(RT_DEBUG_MODULE,("bss\n"));
rt_module_arm_relocate(module, rel, (Elf32_Addr)bss_addr + sym->st_value);
}
- else if(strncmp(shstrab + shdr[sym->st_shndx].sh_name, ELF_DATA, 6) == 0)
+ else if(rt_strncmp(shstrab + shdr[sym->st_shndx].sh_name, ELF_DATA, 6) == 0)
{
/* relocate data section */
RT_DEBUG_LOG(RT_DEBUG_MODULE,("data\n"));
@@ -703,7 +690,8 @@ static struct rt_module* _load_relocated_object(const char *name, void *module_p
}
else
{
- rt_module_arm_relocate(module, rel, addr);
+ rt_module_arm_relocate(module, rel,
+ (Elf32_Addr)((rt_uint8_t*)module->module_space - module_addr + sym->st_value));
}
}
rel ++;