How to access linux symbols from dynamically loaded .so (dlopen)

Nishant Galange nishant.subs at myrealbox.com
Wed Sep 14 19:12:03 EST 2005


Hi all

Help needed desperately. Some background on the problem:

The embedded linux (built as one large elf
file) contains an important function called "board_init()"

A test module (built as a shared object test.so) contains a function
called start_test()

void start_test() {
	board_init(); /* The shared object has to call a function defined in the embedded linux elf image */
	/*Do board tests here... */
}

1. Linux comes up to the command prompt on the board.
2. A GUI application communicates with the board via Ethernet 
3. The GUI
transfers the test module test.so over Ethernet 
4. The downloaded test.so is loaded via dlopen(). 
5. dlopen() and dlsym() calls succeed. start_test() starts executing 
6. It barfs at board_init() saying "Undefined symbol: board_init"

So the dynamically loaded shared object cannot get a reference to a function define in the linux that loaded it...

How do we solve this problem? How do I make sure that symbols in the linux image are exposed to dynamically loaded libraries?

Most probably, it has a simple solution to tweak some compiler/linker
options. But I may be wrong...

Waiting,
Nishant





More information about the Linuxppc-embedded mailing list