dlopen, dlsym does not work in Linux as expected

This is a discussion on dlopen, dlsym does not work in Linux as expected within the C Programming forums, part of the General Programming Boards category; The following is the code where the API dlopen, dlsysm works different in Linux and Solaris,
File: dltrylib.c
****************
Code:
...

Can somebody tell me why this shared library (dltrylib.so) needs to be linked in linux? or What is the alternative solution for this?
This means the dl routines in linux does not suport the direct access to the dynamic linking facilities as expected.

Any support on this line is highly appreciated.
Thanks for your understanding.

External references in the library are resolved using the libraries in that library's dependency list and any other libraries previously opened with the RTLD_GLOBAL flag. If the executable was linked with the flag "-rdynamic" (or, synonymously, "--export-dynamic"), then the global symbols in the executable will also be used to resolve references in a dynamically loaded library.

I studied the manual, and found the option "-rdynamic" (or, synonymously, "--export-dynamic") which should have solved my problem.
But when I tried with "cc --export-dynamic -o dltry dltry.o -ldl -lrt", it was unsuccessfull.

Also,"cc --help -v" gave only
"-E, --export-dynamic Export all dynamic symbols",
as it does not support "-rdynamic" option.