🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.unix.programmer
5 messages
5 total messages Started by Jeff Hallett x5163 Thu, 06 Sep 1990 19:27
Dynamic Loading
#843
Author: Jeff Hallett x5163
Date: Thu, 06 Sep 1990 19:27
22 lines
1377 bytes
Hi folks.

I'm interested in doing something funky.  I have a shell running that
basically interprets user commands and then calls a procedure to
handle the command.  Each command is self-contained.  Now, I want to
allow a user to add commands.  The mechanism I would like to try is to
have the user create a .o file with the compiled code in it, then,
when he enters his command into the shell, have the shell load the .o
file and execute the code in it.  The only problem is that I don't
have a clue where to look to figure out how to do this.

If anyone has an answer or a better idea, I'd love to hear about it.
Please send email and I'll post summaries.

Thanks.

--
	     Jeffrey A. Hallett, PET Software Engineering
      GE Medical Systems, W641, PO Box 414, Milwaukee, WI  53201
	    (414) 548-5163 : EMAIL -  hallettJ@gemed.ge.com
	     "Keep that sense of humor.  It's critical."
Re: Dynamic Loading
#851
Author: Gil Tene
Date: Fri, 07 Sep 1990 22:21
35 lines
2170 bytes
In article <HALLETT.90Sep6142725@enterprise.positron.gemed.ge.com> hallettJ@geme
d.ge.com writes:
>
>I'm interested in doing something funky.  I have a shell running that
>basically interprets user commands and then calls a procedure to
>handle the command.  Each command is self-contained.  Now, I want to
>allow a user to add commands.  The mechanism I would like to try is to
>have the user create a .o file with the compiled code in it, then,
>when he enters his command into the shell, have the shell load the .o
>file and execute the code in it.  The only problem is that I don't
>have a clue where to look to figure out how to do this.
>

Look up the "-A" option in the ld(1) man page. This option lets
you take a .o file, and link it to an existing a.out format file
(executable). The result is a code file that you can load into
memory, and jump into. I have some example code (not well commented)
that does this, if you are interested.

Beware : some unix systems DO NOT have this feature. I am sure it
works in BSD and SunOS, but I have checked DG/UX on an Aviion
(as an example), and it has no -A option to ld.

BTW : This ld -A option is called "incremental" loading. "Dynamic"
loading is a term used concerning run-time and shared library loads.
(At least that's the BSD and SunOS terminology).

Hope this helps,

Gil.
--
--------------------------------------------------------------------
| Gil Tene                      "Some days it just doesn't pay     |
| devil@techunix.technion.ac.il   to go to sleep in the morning."  |
--------------------------------------------------------------------
Re: Dynamic Loading
#848
Author: Eric Schnoebelen
Date: Tue, 11 Sep 1990 04:26
27 lines
1687 bytes
In article <9769@discus.technion.ac.il> 
	devil%techunix.bitnet@lilac.berkeley.edu (Gil Tene) writes:
- In article <HALLETT.90Sep6142725@enterprise.positron.gemed.ge.com> 
-		hallettJ@gemed.ge.com writes:
- >
- >	[Wants to link in objects on the fly]
- 
- Look up the "-A" option in the ld(1) man page.  [...]
- 
- Beware : some unix systems DO NOT have this feature. I am sure it
- works in BSD and SunOS, but I have checked DG/UX on an Aviion
- (as an example), and it has no -A option to ld.

        And some systems use the -A flag for something completely
different.  An example is the ConvexOS loader, which uses -A for a
compiler only type of switch.  ConvexOS is nominally BSD, but the object
format is now a COFF like thing, as opposed the original BSD a.out
format.

        From my other experiences, System V (at least releases 2 and 3+)
don't support ld -A at all.

-- 
Eric Schnoebelen		eric@cirr.com		schnoebe@convex.com
    "This is an important announcement.  This is flight 121 to Los Angeles.
    If your travel plans today do not include Los Angeles, now would be a
    perfect time to disembark." - _So_Long_And_Thanks_For_All_The_Fish_
Re: Dynamic Loading
#846
Author: Guy Harris
Date: Wed, 12 Sep 1990 18:40
7 lines
868 bytes
>        From my other experiences, System V (at least releases 2 and 3+)
>don't support ld -A at all.

I doubt S5R4 does, either, but then it has "dlopen()"/"dlsym()"/etc.
which gives you a built-in dynamic linking mechanism (which "ld -A" does
NOT - you have to write the "load the file" code yourself, or pick up
one of the already-written versions floating around).
Re: Dynamic Loading
#864
Author: Oliver Laumann
Date: Sun, 16 Sep 1990 12:19
10 lines
925 bytes
In the recently announced release 1.2 of the Elk Scheme implementation
you find a function that dynamically loads object files by means of
incremental linking (see file src/load.c in the distribution).
It works under 4.3BSD, Ultrix on the DECStation 3100 (ECOFF format),
NEWS-OS (Sony RISC), HP-UX on the HP9000/3xx, SunOS, and probably others
(but not under System V).

Regards,
--
Oliver Laumann     net@TUB.BITNET     net@tub.cs.tu-berlin.de     net@tub.UUCP
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads