From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f8c9b,9af96ed078e3da0a X-Google-Attributes: gidf8c9b,public X-Google-Thread: 150775,9af96ed078e3da0a X-Google-Attributes: gid150775,public X-Google-Thread: fee84,9af96ed078e3da0a X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-02-03 10:48:09 PST Xref: gmd.de comp.unix.osf.osf1:2137 comp.unix.questions:28098 Newsgroups: comp.unix.osf.osf1,comp.unix.questions,cmu.cs.unix.forum Path: gmd.de!xlink.net!howland.reston.ans.net!paladin.american.edu!europa.eng.gtefsd.com!fs7.ece.cmu.edu!honeydew.srv.cs.cmu.edu!PLAY.TRUST.CS.CMU.EDU!bsy From: bsy+@CS.CMU.EDU (Bennet Yee) Subject: Re: dynamic loading/dumping out of binaries revisited Message-ID: Keywords: osf/1, dynamic loading, unexec, portability Sender: news@cs.cmu.edu (Usenet News System) Nntp-Posting-Host: play.trust.cs.cmu.edu Reply-To: bsy+@cs.cmu.edu Organization: Cranberry Melon, School of Cucumber Science References: Date: Thu, 3 Feb 1994 13:48:09 -0500 In article , snl@paneer.ndim.edrc.cmu.edu (Sean Levy) writes: + [ ... ] +It seems to me that, at least for systems that use COFF, if I could +get the starting virtual address and length of each chunk of VM +containing dynamically loaded code, I could cons up some extra +sections in the header of the dumped out binary which brought those +chunks in at exec time, and then append them to the file (just have to +get the file offsets right in the section headers). Does this sound +right? I haven't taken a serious look at things besides COFF, but it +sounds to me like this would be a reasonable thing to expect to be +able to do. + [ ... ] Why do you want to write out the dynamically loaded stuff when you unexec? Why not just duplicate what crt0.o does before calling main (i.e., mmap'ing in the relevant libraries) instead? Or, better yet, let the native crt0.o code do its thing normally. That way, you benefit from the VM sharing. OSF/1 / SunOS shared libraries uses dynamic loading not just to save disk space for the executable images but also run-time swap space.... If you're doing dld or some other style of dynamic loading -- for run-time code generation or some other purpose -- then this comment doesn't apply. -bsy -- Bennet S. Yee Phone: +1 412 268-7571 Email: bsy+@cs.cmu.edu URL: http://www.cs.cmu.edu:8001/afs/cs.cmu.edu/user/bsy/www/hsh.html CS Dept, SCS, Carnegie Mellon Univ, 5000 Forbes Ave, Pittsburgh, PA 15213-3891