For Programmers: Free Programming Magazines  


Home > Archive > Tcl > December 2006 > how load shared library if load is disabled









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author how load shared library if load is disabled
vkrajan@gmail.com

2006-12-23, 10:05 pm

Hello-

I have an executable with TCL interpreter, but I don't have source code
for this executable. It seems like the loading of shared library inside
this executable has been disabled.

============================
> load libXYZ.so

"load" is not supported
============================

My question: how do I load shared libraries if load has been disabled
inside my executable. Are there any tricks to pre-load the shared
library with some special system-level environment variables?

Any help greatly appreciated.

Rajan

Donal K. Fellows

2006-12-23, 10:05 pm

vkrajan@gmail.com wrote:
> My question: how do I load shared libraries if load has been disabled
> inside my executable. Are there any tricks to pre-load the shared
> library with some special system-level environment variables?


The existence of such "tricks" would constitute a significant security
hole, and as such, no[*] such tricks exist; without the [load] command,
the only way to introduce new commands into an interpreter involves
relinking the binary. (System variable tinkering can be used to load an
alternate shared library, but they get loaded at a stage when the
interpreter structure doesn't exist, making plugging into them more than
a bit difficult).

It might be better to farm out the computation which needs [load]ed code
into a separate Tcl interpreter started with [exec]...

Donal.
[* Or at least none that aren't totally gross, and probably in need of
deep coupling to the system you're running on. If you're going this
way, the key problem is working out how to get a trappable library
call that gives you access to the interpreter at a suitable time. ]
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com