From owner-FreeBSD-tech-jp@jp.freebsd.org  Fri Dec 12 21:33:37 1997
Received: by jaz.jp.freebsd.org (8.8.8+3.0Wbeta7/8.7.3) id VAA08489
	Fri, 12 Dec 1997 21:33:37 +0900 (JST)
Received: by jaz.jp.freebsd.org (8.8.8+3.0Wbeta7/8.7.3) with ESMTP id VAA08484
	for <FreeBSD-tech-jp@jp.freebsd.org>; Fri, 12 Dec 1997 21:33:35 +0900 (JST)
Received: by mie.mrit.co.jp (8.8.4/cf:mrit970101) from mrit [133.185.23.3] with ESMTP
	id VAA05798 for <FreeBSD-tech-jp@jp.freebsd.org>; Fri, 12 Dec 1997 21:33:33 +0900 (JST)
Received: by mrit.mei.co.jp (8.8.4/mrit970130) with ESMTP
	id VAA02446; Fri, 12 Dec 1997 21:33:32 +0900 from [133.185.25.71];
Received: from waltz.codec.mrit.mei.co.jp by waltz.codec.mrit.mei.co.jp (8.8.8/codec-FreeBSD9703)
	id VAA09999; Fri, 12 Dec 1997 21:31:33 +0900 (JST)
Message-Id: <199712121231.VAA09999@waltz.codec.mrit.mei.co.jp>
To: FreeBSD-tech-jp@jp.freebsd.org
In-reply-to: Your message of "Fri, 12 Dec 1997 02:38:05 PST."
             <199712121038.CAA11046@silvia.HIP.Berkeley.EDU> 
From: yasu@mrit.mei.co.jp
Date: Fri, 12 Dec 1997 21:31:33 +0900
Reply-To: FreeBSD-tech-jp@jp.freebsd.org
Precedence: bulk
X-Distribute: distribute [version 2.1 (Alpha) patchlevel=24]
X-Sequence: FreeBSD-tech-jp 1006
Subject: [FreeBSD-tech-jp 1006] Re: Emacs and unexec in 3.0-CURRENT 
Errors-To: owner-FreeBSD-tech-jp@jp.freebsd.org
Sender: owner-FreeBSD-tech-jp@jp.freebsd.org

$BEOJU!w>>2<5;8&$H?=$7$^$9(B.
  >   * $B$A$c$s$HDI$C3]$1$F$J$+$C$?$N$G>\$7$/$OJ,$+$i$J$$$G$9$,(B,
  >   * $B$"$5$_$5$s$,(B`$B;29M(B'$B$K$"$2$F$$$k(B mail $B$N%9%l%C%I$N$I$3$+$K(B
  >   * ld.so $B$r(B 11/25 $BF|$/$i$$$N(Bversion $B$K$7$FF0$+$;$P$$$$$h$_$?$$(B
  >   * $B$J$3$H$,=q$$$F$"$j$^$7$?(B.
  >   * 
  >   * $B$@$+$i(B, $B@53N$K$O(B -current $B$G(B ld.so $B$r:n$jD>$7$F$M(B
  >   * $B$G$O$J$$$+$H;W$C$F$$$^$9(B.
  >  
  >  $B$"$l!"$=$&$G$9$+!#$8$c!"$^$@D>$C$F$J$$$N$+!#$=$l$O:$$j$^$9$M!#(B:<
$B:Q$_$^$;$s(B, $B<+J,$G=q$$$H$$$F2?$G$9$,(B, $B$A$g$C$H$@$1D4$YD>$7$^$7$?(B.
(* $B$G0zMQ$5$l$F$$$kItJ,$O;d$,=q$$$?$b$N$G$9(B.)
rtld.c $B$N(B CVS $B$N(Blog $B$K$3$s$J$3$H$,=q$$$F$"$j$^$7$?(B.
----------------------------------------------------------------------
revision 1.51
date: 1997/12/05 02:06:37;  author: jdp;  state: Exp;  lines: +33 -18
Make emacs work again.  This is a workaround for the fact that the
emacs a.out file, self-generated by emacs's "unexec" function in
"unexsunos4.c", is invalid.  In particular, its "_end" symbol has
the wrong value.  The dynamic linker was using the value of that
symbol to initialize its sbrk break level.

The workaround is to peek at the executable's a.out header in
memory, and calculate what "_end" should be based on the segment
sizes.

I will work out a fix for emacs and send it to the FSF.  This
dynamic linker workaround is still worthwhile, if only to avoid
forcing all emacs users to build a new version.

Note: xemacs gives a bogus warning at startup, for related reasons.
The warning is harmless and can safely be ignored.  I will send a
patch to the xemacs maintainers to get rid of it, and meanwhile
add a patch file to our port.
------------------------------------------------------------------------
$B:rF|$NCJ3,$G(B mule-2.3 $B$r(Brecompile $B$7$F$bF0$+$J$+$C$?$/$F(B,
ld.so $B$r:n$jD>$7$?$iF0$/$h$&$K$J$C$?$N$G(B, $BH?<ME*$K(B mail $B$r(B
$B=q$$$F$7$^$$$^$7$?(B.



