Q: Loading code at runtime ?

Q: Loading code at runtime ?

Post by Andre Holzne » Wed, 02 Jul 1997 04:00:00



Hello and thanks for reading this message !

Is there a way to load object files at runtime and use it ? Yes, DLL
do this as far as I know, but I can not have two different versions
of the same dll at the same time, can I ?

I'm speaking of something similar to the module mechanism the kernel
uses. I think of a function that loads an object file into memory,
performs relocation of the code (as far as necessary ?) and then it
should be possible to convert a (function) name contained in that
object file to a valid pointer. Is there such a mechanism ?

best regards,

Andre Holzner

----------------------------------------------------------------------


 
 
 

Q: Loading code at runtime ?

Post by Peter Verth » Wed, 02 Jul 1997 04:00:00


: Hello and thanks for reading this message !
:
: Is there a way to load object files at runtime and use it ? Yes, DLL
: do this as far as I know, but I can not have two different versions
: of the same dll at the same time, can I ?
:
: I'm speaking of something similar to the module mechanism the kernel
: uses. I think of a function that loads an object file into memory,
: performs relocation of the code (as far as necessary ?) and then it
: should be possible to convert a (function) name contained in that
: object file to a valid pointer. Is there such a mechanism ?

You'll probably be interested in dlopen and the likes
(do: man dlopen).

Hope this helps.
--
Peter Verthez                                 Software Engineer


WWW:                         http://www.club.innet.be/~pub01180
This post is personal and not related to any company whatsoever.

 
 
 

Q: Loading code at runtime ?

Post by Hartmut Niema » Wed, 02 Jul 1997 04:00:00



>Is there a way to load object files at runtime and use it ? Yes, DLL
>do this as far as I know, but I can not have two different versions
>of the same dll at the same time, can I ?
>I'm speaking of something similar to the module mechanism the kernel
>uses. I think of a function that loads an object file into memory,
>performs relocation of the code (as far as necessary ?) and then it
>should be possible to convert a (function) name contained in that
>object file to a valid pointer. Is there such a mechanism ?

There is a dynamic library in the GGI project. Maybe look there:
http://synergy.caltech.edu/~ggi/
and get the ggilib-dynamic from one of the snapshop pages.

I have not investigated into details but it looks like they do what you want.

Hartmut.

 
 
 

Q: Loading code at runtime ?

Post by Kai S. Wo » Thu, 03 Jul 1997 04:00:00



>Hello and thanks for reading this message !
>Is there a way to load object files at runtime and use it ? Yes, DLL
>do this as far as I know, but I can not have two different versions
>of the same dll at the same time, can I ?
>I'm speaking of something similar to the module mechanism the kernel
>uses. I think of a function that loads an object file into memory,
>performs relocation of the code (as far as necessary ?) and then it
>should be possible to convert a (function) name contained in that
>object file to a valid pointer. Is there such a mechanism ?

How about NSBundle in Objective-C.  Check out in www.gnustep.org for
more info.

kai

--

Software Engineer

url:    http://web.cs.mun.ca/~kwong/

PGP fingerprint <1B 67 F5 6C C4 44 4F 87  52 F7 61 C7 8E D0 36 40>

 
 
 

1. Dynamic runtime code loading

We have a program that we would like to be able to dynamically load
functions into.  It is c++ running on sparc solaris 8.

The scenario we have is that our application is given the command string
"foo", it looks to see if function "foo" currently exists in the system,
if not it looks in a directory to see if there is a file named "foo.o" (or
"foo.so" not sure what works best), if so it loads in the file then calls
the function foo.

My questions are.

1. Is there a way to dynamically load code at runtime.

and if so

2. Is there a way to find out the address of a function residing in the
above dynamically loaded code so that it can actually be executed.

-shane

2. Set DATE Command searched

3. Loading and Executing Object Code at Runtime

4. add me...

5. editres2: Loading resources (i.e. new language) at runtime!

6. help in awk

7. Loading libraries run-time: dlopen, dlsym, dlclose

8. Please help -- undefined symbols ___fpu_control and ___setfpucw

9. Run-time library for c-compiled code on UNIX

10. Linux Equivalent for Win Runtime DLL Loading

11. Incrementally run-time loading, how?

12. How to load library objects during runtime?

13. runtime loading of elf files - how ?