Dynamic symbol table olvasása.

Fórumok

Pár perce olvasgattam egy Gtk tutoriált, és megakadt a szemem ezen:

gtk_builder_connect_signals (builder, NULL);

Ez ugye automatikusan beállítja a callback fv-eket (aka. signal connect).
A kérdés csak az, hogy hogyan?

Dynamic lib-nél még olvasható lenne a szimbólumtábla, de itt csak egy futtatható állomány van. Mégis hogy működik ez?

Hozzászólások

Nem tudom, hogy pontosan hogy működik, de futás közben is értelmezhető a symtable a dynamic linker segítségével (lásd pl pluginok). Szerintem ha dlopen-el megnyitod argv[0]-át, az is menni fog. (Tipp)

A tipp majdnem jó:

"The function dlopen() loads the dynamic library file named by the null-terminated string filename and returns an opaque "handle" for the dynamic library. If filename is NULL, then the returned handle is for the main program."

Már csak egy kérdés maradt:
Végig lehet iterálni valahogy a szimbólumtábla bejegyzésein?

"...handing C++ to the average programmer seems roughly comparable to handing a loaded .45 to a chimpanzee."
-- Ted Ts'o