the better way to do this is to put 'bar()' in another shared object, and dlopen() it before the "module" with the RT_GLOBAL flag.
I put the modified stuff in http://manticore.2y.net/temp/callbacks thanks, Pawel. On Wed, Nov 29, 2006 at 10:36:20AM -0600, Dale Rahn wrote: >Hmm, it seems that -rdynamic is a non-standard flag here. > >Use '-Wl,-E' or '-Wl,--export-dynamic'. Check the ld(1) man page >for '-E' and '--export-dynamic' options. > >http://www.cim.mcgill.ca/~franco/OpSys-304-427/messages/node59.html > >On Wed, Nov 29, 2006 at 03:52:37PM +0000, Brian Candler wrote: >> I am in the process of trying to port rp-l2tp to openbsd. >> >> I have a problem with dlopen(). rp-l2tp calls dlopen() to load its >> sync-pppd.so module, and this in turn has callbacks to functions defined in >> the main program. However under OpenBSD these callbacks fail to link. [ skipped ] >> # >> >> Under Linux it seems that '-rdynamic' is the magic incantation, because >> without this it also fails. However I don't know what the OpenBSD equivalent >> is. >> >> Could someone provide me with the necessary clue please?