[17952] in Athena Bugs
Re: sgi 8.3.29: emacs
daemon@ATHENA.MIT.EDU (John Carr)
Wed Jun 28 19:48:30 2000
Message-Id: <200006282348.TAA02697@nerd-xing.mit.edu>
To: Greg Hudson <ghudson@MIT.EDU>
cc: bugs@MIT.EDU
In-Reply-To: Your message of "Sun, 25 Jun 2000 12:57:36 EDT."
<200006251657.MAA13905@small-gods.mit.edu>
Date: Wed, 28 Jun 2000 19:48:25 -0400
From: John Carr <jfc@MIT.EDU>
This is a fix to make emacs work when compiled -n32 and undumped.
n32 files seem to contain a couple extra data sections that need
to be preserved during undumping. Without this change emacs will
crash following infinite recursion. The -use_readonly_const change
assumes the SGI C compiler, which I used for testing.
Compared to the 8.3 o32 emacs, my n32 emacs is significantly smaller:
/var/jfc/b/src/emacs: 1642496 + 2166784 + 0 = 3809280
/usr/athena/bin/emacs: 2031616 + 2228224 + 0 = 4259840
(although if 8.3 emacs was compiled with gcc this isn't a fair test)
*** unexsgi.c.orig Wed Sep 25 20:58:37 1996
--- unexsgi.c Wed Jun 28 19:36:21 2000
***************
*** 723,728 ****
--- 723,729 ----
for (n = 1, nn = 1; n < old_file_h->e_shnum; n++, nn++)
{
caddr_t src;
+ char *tname;
/* If it is bss section, insert the new data2 section before it. */
if (n == old_bss_index)
***************
*** 785,794 ****
/* Write out the sections. .data and .data1 (and data2, called
".data" in the strings table) get copied from the current process
! instead of the old file. */
! if (!strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".data")
! || !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".data1")
! || !strcmp (old_section_names + NEW_SECTION_H (n).sh_name, ".got"))
src = (caddr_t) OLD_SECTION_H (n).sh_addr;
else
src = old_base + OLD_SECTION_H (n).sh_offset;
--- 786,797 ----
/* Write out the sections. .data and .data1 (and data2, called
".data" in the strings table) get copied from the current process
! instead of the old file. In N32 objects, .sdata and .sbss also
! must be written from the process. */
! tname = old_section_names + NEW_SECTION_H (n).sh_name;
! if (!strcmp (tname, ".data") || !strcmp (tname, ".data1")
! || !strcmp(tname, ".sbss") || !strcmp(tname, ".sdata")
! || !strcmp (tname, ".got"))
src = (caddr_t) OLD_SECTION_H (n).sh_addr;
else
src = old_base + OLD_SECTION_H (n).sh_offset;
*** /mit/source/third/emacs/src/s/irix6-5.h Sat Jan 16 16:52:52 1999
--- ./irix6-5.h Wed Jun 28 18:10:08 2000
***************
*** 1,5 ****
--- 1,11 ----
#include "irix6-0.h"
+ #undef IRIX_FORCE_32_BITS
+ #undef C_SWITCH_SYSTEM
+ #if !(defined THIS_IS_MAKEFILE || defined NOT_C_CODE)
+ #define C_SWITCH_SYSTEM -use_readonly_const
+ #endif
+
/* Undo explicit '-32' link for lib-src */
#ifndef THIS_IS_EMACS
#undef LD_SWITCH_SYSTEM