Loading object files to running program..

Jussi Eloranta eloranta at tukki.jyu.fi
Wed Dec 27 16:57:54 AEST 1989


Thanks to everybody who responsed.

Here is a quick summary what to do (sunos; bsd without static stuff, I guess):

1) find the address of top of mem. (top = sbrk(0))

2) do: ld -Bstatic -N -x -A a.out -T top objfile.o -e _entry -o tmpfil libs.a\
       -lc
   (-T top specifies the address)

3) read tmpfil header (total size) and allocate space using sbrk(totsize)

4) read the tmpfil in.

5) call header.a_entry ()

If anoyone wants the examples I got I can mail those.

Jussi
-- 
============================================================================
Jussi Eloranta               Internet(/Bitnet):
University of Jyvaskyla,     eloranta at tukki.jyu.fi
Finland                      [128.214.7.5]



More information about the Comp.unix.wizards mailing list