Skip to content

Commit 5eb5341

Browse files
Add priority & stack_size param parsing for dlmodule
1 parent 04c20bc commit 5eb5341

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

components/libc/libdl/dlelf.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,24 @@ rt_err_t dlmodule_load_shared_object(struct rt_dlmodule* module, void *module_pt
226226
length);
227227
count ++;
228228
}
229+
230+
/* get priority param */
231+
for (i = 0; i < shdr[index].sh_size / sizeof(Elf32_Sym); i++)
232+
{
233+
if (rt_strcmp((const char *)(strtab + symtab[i].st_name), "dlmodule_thread_priority") == 0)
234+
{
235+
module->priority = *(rt_uint16_t*)(module->mem_space + symtab[i].st_value - module->vstart_addr);
236+
}
237+
}
238+
239+
/* get stack size param */
240+
for (i = 0; i < shdr[index].sh_size / sizeof(Elf32_Sym); i++)
241+
{
242+
if (rt_strcmp((const char *)(strtab + symtab[i].st_name), "dlmodule_thread_stacksize") == 0)
243+
{
244+
module->stack_size = *(rt_uint32_t*)(module->mem_space + symtab[i].st_value - module->vstart_addr);
245+
}
246+
}
229247
}
230248

231249
return RT_EOK;

0 commit comments

Comments
 (0)