[net.unix] ld and the -A option

allen@gitpyr.gatech.EDU (P. Allen Jensen) (10/28/86)

Can anyone explain exactly how this feature may be used ?  The man page
indicates that it may be used to generate an a.out file that may be
read into an already executing program (eg like an overlay or dynamic
loading ???).  It is not clear how this can be done.

bzs@bu-cs.BU.EDU (Barry Shein) (11/03/86)

>Can anyone explain exactly how this feature may be used ?  The man page
>indicates that it may be used to generate an a.out file that may be
>read into an already executing program (eg like an overlay or dynamic
>loading ???).  It is not clear how this can be done.

Yes, you (and the man page) are correct, for example Franz Lisp uses
the -A flag to relocate compiled lisp modules for loading. Similarly
I once wrote a dynamic link loader which used -A similarly.
(sorry, it was under contract, I don't own it.)

The basic idea is that you figure out where the code will want to be
loaded and build and run an 'ld -A xyzzy' command to re-locate it, the
rest is fairly straightforward (after staring at things for a while.)
You may want to have a look at the -T option also.

	-Barry Shein, Boston University