提交 ba507951 编写于 作者: qiuyiuestc's avatar qiuyiuestc

update module

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1233 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 aa1a7808
...@@ -381,7 +381,7 @@ rt_module_t rt_module_load(const rt_uint8_t* name, void* module_ptr) ...@@ -381,7 +381,7 @@ rt_module_t rt_module_load(const rt_uint8_t* name, void* module_ptr)
if (rt_strcmp(shstrab + shdr[index].sh_name, ELF_DYNSYM) == 0) break; if (rt_strcmp(shstrab + shdr[index].sh_name, ELF_DYNSYM) == 0) break;
} }
/* found .dynsyn section */ /* found .dynsym section */
if(index != elf_module->e_shnum) if(index != elf_module->e_shnum)
{ {
int i, count = 0; int i, count = 0;
...@@ -414,19 +414,6 @@ rt_module_t rt_module_load(const rt_uint8_t* name, void* module_ptr) ...@@ -414,19 +414,6 @@ rt_module_t rt_module_load(const rt_uint8_t* name, void* module_ptr)
} }
} }
#if 0
/* construct module symbol table */
for (index = 0; index < elf_module->e_shnum; index ++)
{
rt_uint8_t* shstrab = (rt_uint8_t*) module_ptr + shdr[elf_module->e_shstrndx].sh_offset;
if (rt_strcmp(shstrab + shdr[index].sh_name, ELF_RTMSYMTAB) == 0)
{
module->symtab = (struct rt_module_symtab *)(module->module_space + shdr[index].sh_addr);
module->nsym = shdr[index].sh_size / sizeof(struct rt_module_symtab);
}
}
#endif
/* init module object container */ /* init module object container */
rt_module_init_object_container(module); rt_module_init_object_container(module);
...@@ -442,7 +429,7 @@ rt_module_t rt_module_load(const rt_uint8_t* name, void* module_ptr) ...@@ -442,7 +429,7 @@ rt_module_t rt_module_load(const rt_uint8_t* name, void* module_ptr)
module->mem_list = RT_NULL; module->mem_list = RT_NULL;
/* create mpool for page node */ /* create mpool for page node */
module->mpool = rt_mp_create(name, 1024, sizeof(struct rt_module_page)); module->mpool = rt_mp_create(name, 256, sizeof(struct rt_module_page));
/* create module thread */ /* create module thread */
module->stack_size = 2048; module->stack_size = 2048;
...@@ -483,6 +470,9 @@ rt_module_t rt_module_open(const char* filename) ...@@ -483,6 +470,9 @@ rt_module_t rt_module_open(const char* filename)
struct stat s; struct stat s;
char *buffer, *offset_ptr;; char *buffer, *offset_ptr;;
/* check parameters */
RT_ASSERT(filename != RT_NULL);
if (stat(filename, &s) !=0) if (stat(filename, &s) !=0)
{ {
rt_kprintf("access file failed\n"); rt_kprintf("access file failed\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册