1 /* 2 * Copyright (c) 2006-2018, RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 * 2010-11-17 yi.qiu first version 9 */ 10 11 #include <rtthread.h> 12 #include <rtm.h> 13 14 #include "dlmodule.h" 15 16 void* dlsym(void *handle, const char* symbol) 17 { 18 int i; 19 struct rt_dlmodule *module; 20 21 RT_ASSERT(handle != RT_NULL); 22 23 module = (struct rt_dlmodule *)handle; 24 25 for(i=0; i<module->nsym; i++) 26 { 27 if (rt_strcmp(module->symtab[i].name, symbol) == 0) 28 return (void*)module->symtab[i].addr; 29 } 30 31 return RT_NULL; 32 } 33 RTM_EXPORT(dlsym) 34