[comp.sys.sgi] run time loading

mpapp@ (Mike Papper) (01/25/91)

For SGI IRIX 3.3 does anyone have routines that will allow
me to link in routines on the fly?
I want to use them to find the address of a function from its
character string representation (its label).

I believe the ldfcp() and similar functions allow
access to the symbol table, in a machine-independent manner (via unix)
but I don't have the faintest idea of how to go about finding out how to use these commands.
If anyone has tried this before, or used these routines, maybe they could
let me have some info on them.

Mike Papper
mpapp@godzilla.cgl.rmit.oz.au

Dan Karron@UCBVAX.BERKELEY.EDU (01/26/91)

I have code to read and crack the Mips/Third Eye symbol table.

I plan to put it on my anon ftp in a few days once I get a change
to stand back from it, and see how it hangs.

I can see how to use the reloc record entries from a .o file
and link it in with symbols already loaded statically, and
then resolve dynamically symbols and procs by allocating them
on the heap.

I have had it in mind to do precisely what you want, a
loader to permit 'non static' or 'automatic' code. This is usefull for
code that is only needed once to initalize a data structure, or for
subroutines that you change on the fly and reload. 

However, if you have enough memory, you can always keep your subroutine
code in static text core and leave well enough alone. This type of
memory optimization is mostly used for squeezing code into limited
memory or making a program small enough that it is not rolled in and out
of core in a vm system.

I would be intested in what your application is. 

This area is a mips black art. I had basically had to hack the
stdump and odump to see how things worked. The documentation is
poor to wrong. 

I would like to thank Dave Anderson at sgi for his
patience and help. He graciously shared his experience with this
black magic, and put up with my complaining to him about the lack
of logic and documentation in the data structures. Without his help 
I could not of gotten this far.

I would be interested if anyone else has been down this road before.
I have seen some code from the Free Software Foundation that
may or may not work that is reputed to do something like this.

>Organization: RMIT Computer Centre, Melbourne Australia.
>Subject: run time loading
>Message-Id: <mpapp.664802366@godzilla>
>Sender: info-iris-request@BRL.MIL
>To: info-iris@BRL.MIL
>
>For SGI IRIX 3.3 does anyone have routines that will allow
>me to link in routines on the fly?
>I want to use them to find the address of a function from its
>character string representation (its label).
>
>I believe the ldfcp() and similar functions allow
>access to the symbol table, in a machine-independent manner (via unix)
>but I don't have the faintest idea of how to go about finding out how to use these commands.
>If anyone has tried this before, or used these routines, maybe they could
>let me have some info on them.
>
>Mike Papper
>mpapp@godzilla.cgl.rmit.oz.au
>
+-----------------------------------------------------------------------------+
| karron@nyu.edu (E-mail alias that will always find me)                      |
| Fax: 212 263 7190           *           Dan Karron, Research Associate      |
| . . . . . . . . . . . . . . *           New York University Medical Center  |
| 560 First Avenue           \*\    Pager <1> (212) 397 9330                  |
| New York, New York 10016    \**\        <2> 10896   <3> <your-number-here>  |
| (212) 263 5210               \***\_________________________________________ |
| Main machine: karron.med.nyu.edu (128.122.135.3) IRIS 85GT                  |
+-----------------------------------------------------------------------------+

NOTE PHONE NUMBER CHANGE: The Med Ctr has changed from 340 to 263 exchange.