From owner-freebsd-questions Mon Dec 18 16:40:33 1995 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id QAA01793 for questions-outgoing; Mon, 18 Dec 1995 16:40:33 -0800 (PST) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id QAA01783 for ; Mon, 18 Dec 1995 16:40:28 -0800 (PST) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id RAA13127; Mon, 18 Dec 1995 17:36:27 -0700 From: Terry Lambert Message-Id: <199512190036.RAA13127@phaeton.artisoft.com> Subject: Re: undump program To: hlew@genome.Stanford.EDU (Howard Lew) Date: Mon, 18 Dec 1995 17:36:27 -0700 (MST) Cc: gpalmer@westhill.cdrom.com, terry@lambert.org, questions@FreeBSD.ORG In-Reply-To: from "Howard Lew" at Dec 18, 95 02:12:47 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@FreeBSD.ORG Precedence: bulk > Here's the whole rationale for what I want to do: > 1) Take a long perl program > 2) Intentionally dump the perl program to become an executable binary > 3) Run the binary at a later time You should note that this will only save on the state precalculation for the interpreter. That is, it will allow you to be lazy about precalculating information that you precaclulate in perl instead of doing so outside of perl and updating your actual perl code appropriately. It will not "compile" the perl program to a "binary". It will make a copy of the existing perl interpreter, and fill out some auto data (including the default stack an PC). There is no significant advantage to this approach over restructuring your perl script based on splitting the precaclulation out to allow you to execute it only once and hard-code the results in the perl script. The resulting "binary" will run at the same speed. The one potential advantage, "copy protection", is lost if anyone wants to take the trouble to take the core image data sections vs. a "standard" perl binary, and dump them out. That is, the amount of effort to "crack" this is similar to the amount of effort necessary to make "undump" work. I believe the emacs "unexec" works on FreeBSD, or did last time I looked. You can get the same functionality by using that instead (as has been suggested by others), if you don't want to hassle with doing a port of "undump". This may be mildly useful for a perl program that was written such that it's hard to update modularly to take advantage of seperate precalculation; IMO, I'd rather fix the perl program than make the undump work. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.