Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!oliveb!orc!mipos3!pinkas From: pinkas@joker.intel.com (Israel Pinkas) Newsgroups: gnu.emacs Subject: Dumping, shared/dynamic libs, and SysVR4 Message-ID: Date: 26 Dec 89 00:06:40 GMT Sender: news@mipos3.intel.com Distribution: gnu Organization: Software Technologies, INTeL Corporation, Santa Clara, CA Lines: 98 About a year ago, I saw a suggestion for modifying Emacs to avoid dumping. The suggestion (as I remember it) was that the dumped code be written out as a C module which initialized an array. This module would then be linked in to the final Emacs. (A dummy version of this module would be supplied to do the initial build.) I am currently looking into bringing Emacs up on Sys 5.4. I am running into a number of problems that the above solution will avoid. (Not just fix, completely avoid.) The major problems that I have hit are that the format for binaries/object modules has changed. Sys 5.4 uses something called ELF. (COFF modules are converted to ELF by our linkers on the fly.) The ELF format in and of itself is not a problem, it would just require some work to unexec.c. However, Sys 5.4 also supports dynamic libs in addition to the shared libs of Sys 5.3.2. Unfortunately, neither shared nor dynamic libraries are supported by Emacs at the current time. (Somebody did send me a copy of work that he had done to get Emacs to use SunOS 4.0 dynamic libs. I had problems that I never resolved when I tried to build Emacs with X11. Unfortunately, I lost the message that described the fixes.) I believe that this would make building Emacs easier on many architectures. It would also allow the use of dynamic and shared libraries. Last, it would allow many systems to put the "dumped" lisp code in the shareable text portion. The reasoning behind the last is that many systems (almost all Unix systems) have C compilers that generate "AT&T style" assembly code that uses .text and .data to separate the text and data portions. For example, for the following program: char foo[] = { 0x00, 0x10, 0x30, 0x88, 0xff }; my i386 compiler (Sys V.3.2) generates the following: .file "t.c" .version "02.01" .data .globl foo foo: .long 0x88301000 .long 0x000000ff and my i860 compiler (Sys V.4 cross environment) generates: .file "t.c" .version "01.01" .data .globl foo .align 1 foo: .byte 0 .byte 16 .byte 48 .byte 136 .byte 255 .type foo,"object" .size foo,5 By inserting a .text right before the .globl foo, the whole array would be placed in the text portion of the executable. A simple sed script would take care of this for 99% of all unix systems. System dependant scripts would be very easy to write. Those system that could not do this would be no worse off than they are now. My first question is whether anybody has actually made this kind of change in Emacs. If so, would you please get in contact with me. My next question is whether any of this is already in v19? If so, would whoever is working on it please let me know so that I don't re-invent the wheel. Last, could anybody point me in the right direction for implementing this on my own. Do I just need to dump the lisp or is there anything else that I need to worry about. I realize that this is a large undertaking, but I am determined to bring Emacs up on my Sys 5.4 boxes. (I'll have a 486 box and an 860 box to worry about. What makes this harder is that for the 860 we still are doing a lot of our compilation on the 486 with cross compilation tools. Thanks, -Israel -- -------------------------------------- Disclaimer: The above are my personal opinions, and in no way represent the opinions of Intel Corporation. In no way should the above be taken to be a statement of Intel. UUCP: {decwrl,hplabs,oliveb,pur-ee,qantel}!intelca!mipos3!st860!pinkas ARPA: pinkas%st860.intel.com@relay.cs.net CSNET: pinkas@st860.intel.com