[comp.sys.amiga.tech] Questions about shared libraries

karl@sugar.hackercorp.com (Karl Lehenbauer) (03/08/90)

Last night I tried to go ahead and finish making Tcl into a shared
library.  I am using the Manx 5.0 shared library stuff to make it.

I got everything to link cleanly and I can open and close the library OK,
but I get a task held when I try to call the function to create an
interpreter.  Stepping through the call with sdb in assembly mode, it
seems to make it through the indirect call and through the jump table
into the routine OK, but not too long after that it does an indirect
jump through a6 to an unitialized vector and ends up with the PC around
FFFFFFCB or so.

The questions are, how should a routine in a shared library call another
routine in the same shared library?  If I build the library with the
pragmas included, I get TclaBase as undefined, which isn't much of a 
surprise.  Also, is there any problem with linking routines into a
shared library that aren't callable through the shared library?  I am
thinking of things like strcpy and strcat.  And if I want to call AllocMem 
from inside the library for example, do I have to do something to get
the right address in a6?

I removed the stuff that linked in stuff from the I/O libraries that
wasn't reentrant, mostly stuff that had private global data.  I'm
not trying to printf or anything.
-- 
-- uunet!sugar!karl	"As long as there is a legion of superheros, all else
--			 can surely be made right." -- Sensor Girl
-- Usenet access: (713) 438-5018