I have a shared library that I implemented and want the .so to call a function that's implemented in the main program which loads the library.
Let's say I have main.c (executable) which contains:
void inmain_function(void*);dlopen("libmy.so");
In the my.c (the code for the libmy.so) I want to call inmain_function
:
inmain_function(NULL);
How can the shared library call inmain_function
regardless the fact inmain_function
is defined in the main program.
Note: I want to call a symbol in main.c from my.c not vice versa which is the common usage.