From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ali Bahrami Newsgroups: gmane.emacs.devel Subject: Re: Question about dumping emacs under Solaris Date: Fri, 04 Jul 2008 12:34:55 -0600 Message-ID: <486E6D4F.5060807@emvision.com> References: <486DA1C5.7030304@emvision.com> <200807040739.m647daXU022629@sallyv1.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1215196527 27763 80.91.229.12 (4 Jul 2008 18:35:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Jul 2008 18:35:27 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dan Nicolaescu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 04 20:36:14 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KEq8d-0008A1-2T for ged-emacs-devel@m.gmane.org; Fri, 04 Jul 2008 20:36:07 +0200 Original-Received: from localhost ([127.0.0.1]:41478 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KEq7m-0008N8-59 for ged-emacs-devel@m.gmane.org; Fri, 04 Jul 2008 14:35:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KEq7h-0008N3-6R for emacs-devel@gnu.org; Fri, 04 Jul 2008 14:35:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KEq7g-0008Mr-MT for emacs-devel@gnu.org; Fri, 04 Jul 2008 14:35:08 -0400 Original-Received: from [199.232.76.173] (port=40796 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KEq7g-0008Mo-Gg for emacs-devel@gnu.org; Fri, 04 Jul 2008 14:35:08 -0400 Original-Received: from vc7-1-94b.dsl.netrack.net ([199.45.162.234]:16289 helo=emvision.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KEq7g-0007GQ-6v for emacs-devel@gnu.org; Fri, 04 Jul 2008 14:35:08 -0400 Original-Received: from pod.emvision.com (pod.emvision.com [198.182.198.2]) by emvision.com (8.13.6/8.13.6) with ESMTP id m64IYvpU029414; Fri, 4 Jul 2008 12:34:57 -0600 (MDT) User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) In-Reply-To: <200807040739.m647daXU022629@sallyv1.ics.uci.edu> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (emvision.com [198.182.198.5]); Fri, 04 Jul 2008 12:35:07 -0600 (MDT) X-detected-kernel: by monty-python.gnu.org: Solaris 9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:100351 Archived-At: Dan Nicolaescu wrote: > Ali Bahrami writes: > > > Hello, > > > > I have a question about how emacs is dumped under > > Solaris. In the file emacs/src/s/sol-2-6.h: > > > > /* Handle Solaris 2.6. */ > > > > #include "sol2-5.h" > > > > #if 0 /* dldump does not handle all the extensions used by GNU ld. */ > > #undef UNEXEC > > #define UNEXEC unexsol.o > > #endif > > > > This ifdef prevents the unexsol.c code, containing a call > > to dldump(), from being used. Instead, the generic ELF unexec > > code is used. Looking at the RCS revisions, I see that dldump() > > was disabled in revision 1.3 of the file, dating from > > September 13, 2002. > > > > Can anyone shed any light on what GNU ld extensions are not > > properly handled by the Solaris dldump()? I know that 2002 > > was a while ago, and possibly no one remembers, but it > > would be helpful to know what went wrong. > > > > I work at Sun, on the linker. We've discussed this, and are at > > a loss as to what the problem might be. dldump() is pretty > > generic, and nothing leaps out as being unable to support GNU > > ld objects. There are some differences between the ELF objects > > produced by the Solaris and GNU, but they tend to be pretty > > compatible for the most part. > > Regardless if anyone remembers why those changes were made, positive > proof that the code works is the best option. > > Given what you said above, you are probably able to experiment with > building with various versions of both Sun and GNU tools, on various > Solaris versions and check if emacs works correctly. > > If things work OK, then there's no reason not to enable the code in > question immediately. In the absence of any other information, that's probably the best we can do. I can do the obvious tests (build it, show it runs, use it for awhile). That's not what I'd call positive proof, but it may be our only path forward. I should probably provide more details on why I'm asking about this. I built an emacs recently on solaris, and then ran elfdump on it: % elfdump emacs 2>&1 When you run elfdump this way (throwing away stdout), what's left are the errors --- things elfdump is suspicious about in the object. Ideally, there's no output. In the case of emacs, it generates a large number of errors regarding overlap of the symbol table and the data sections. This happens because the bss section in the original temacs gets turned into actual data in the object, which ends up being written where the symbol table was. The resulting object runs fine, but has a corrupt symbol table, which might be an issue for debuggers and other observability tools. dldump() rewrites the output object in a way that shifts the non-allocable stuff (including the symbol table) down and preserves them. That's the main advantage of dldump() --- it's not like the generic ELF code isn't working adequately. For that reason, I'm not particularly concerned about older Solaris versions. They can keep dumping emacs in the old way. My interest is solely for the current head of the Solaris tree, which we call Nevada internally, and which is visible via OpenSolaris. So my test matrix is really pretty small. Solaris and GNU ld, on sparc and intel. I've already built the Solaris ld versions with dldump(), and have been using it as my daily editor for most of last week without issue. I'll keep poking at it, and if things seem solid, perhaps I'll submit the change. Thanks for your help. - Ali