Skip to content
Search

Libdl

lastmod 2020-02-29created 2016-02-186 edits

Dynamic Loader.

Dynamic Loader Function Interfaces

  • dladdr
  • dlclose
  • dlerror
  • dlopen
  • dlsym

See also

Troubleshooting

Not found symbol

If the dlsym function cannot find a symbol, check it with nm as follows:

$ nm libc2rtc.so
0000000000004d60 t _c2cPluginBaseInfo

If the symbol is a lowercase t as above, it cannot be called. You need to export the function using GCC:Attribute.

// Windows:
#define EXPORT_DEF __declspec(dllexport)
// GCC
#define EXPORT_DEF __attribute__((visibility("default")))
// ...
EXPORT_DEF void _c2cPluginBaseInfo() { ... }

After compiling, checking with nm as below shows that it has changed to an uppercase T.

$ nm libc2rtc.so
0000000000004d20 T _c2cPluginBaseInfo

For reference, a lowercase t is located in the local text section, and an uppercase T in the global (external) text section.

Favorite site

Symbol load tips

author Zer0 sitemap