Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!mit-eddie!uw-beaver!tektronix!reed!nscpdc!joer From: joer@nscpdc.NSC.COM ( Joe Rawlings ) Newsgroups: comp.sys.nsc.32k Subject: Re: Bug in SysV ld? Message-ID: <897@nscpdc.NSC.COM> Date: Wed, 12-Aug-87 17:00:25 EDT Article-I.D.: nscpdc.897 Posted: Wed Aug 12 17:00:25 1987 Date-Received: Sat, 15-Aug-87 11:48:36 EDT References: <224@augean.OZ> Reply-To: joer@nscpdc.UUCP ( Joe Rawlings ) Distribution: world Organization: NSC Portland Development Center Lines: 50 Edited for brevity sake: In article <224@augean.OZ> idall@augean.OZ (Ian Dall) writes: >I've been trying to build GNU emacs (version 17) on my ICM 3216 (SysV). I can't >get unexec to work and the reason seems to be that there is a hole in the >virtual address space of executables produced by ld. > >The hole is between the .text and .data segments. Its size varies depending >on the size of .text (presumably) but it is NOT just the gap to the next >page boundary. > >Is this a bug? Admittedly the wasted virtual address space would not normally >be a problem. Interestingly the .data segment doesn't start on a page boundary. > >There is ld -N but that has the undesirable side effect of making the text >segment unsharable. >-- No, it is not a bug. The text region is a read only region. The data region is a read/write region. The kernel supports a region granularity of 64K. When the file is on disk, the text and data regions are adjacent (no gap). When a program is loaded, the text region is assigned enough pages to store all the text and will almost always contain a small portion of the data. Likewise, the data region is assigned enough pages to store all the data and will almost always start off with a small amount of text. UNIX (tm) knows where the actual data segment starts. As an example, assume a program that has equal sized text and data segments and occupies 5 pages. When the program is loaded, the text segment will contain 3 pages, the last of which contains some data, and the data segment will contain 3 pages, the first of which will contain some text. The middle page is duplicated, once in each region. There is a gentleman who had the same problem you are having with version 17 last Februrary. He has now sucessfully ported version 18 of Gnuemacs to his ICM-3216 and has posted instructions and help files to the net on this same group. If you are interested and can obtain version 18, I can email you his notes. By the way, he solved the gap problem by filling in "0"'s and adjusting address data and eof of text to a 64K boundry. JR -- /****************************************************************************** * * * Joe Rawlings nsc!nscpdc!joer * * ICM Product Support tektronix!reed!nscpdc!joer * * National Semiconductor Corp. 1-800-222-2433 (outside Oregon) * * Portland Development Center (503)-629-4414 (Oregon/World) * * * ******************************************************************************/