From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Drazen Kacar Newsgroups: gmane.emacs.bugs Subject: unexelf.c doesn't always work on Solaris Date: Wed, 21 Aug 2002 02:54:58 +0200 Sender: bug-gnu-emacs-admin@gnu.org Message-ID: <20020821025458.A1646@raven.munich.redhat.com> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1029891302 23622 127.0.0.1 (21 Aug 2002 00:55:02 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 21 Aug 2002 00:55:02 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17hJm0-00068k-00 for ; Wed, 21 Aug 2002 02:55:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17hJn9-0003kS-00; Tue, 20 Aug 2002 20:56:11 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17hJm5-0003Lz-00 for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2002 20:55:05 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17hJm3-0003Jp-00 for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2002 20:55:04 -0400 Original-Received: from rh.customer.muc.de.colt.net ([213.61.79.94] helo=raven.munich.redhat.com) by monty-python.gnu.org with esmtp (Exim 4.10) id 17hJm2-0003J4-00 for bug-gnu-emacs@gnu.org; Tue, 20 Aug 2002 20:55:02 -0400 Original-To: bug-gnu-emacs@gnu.org Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:3256 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:3256 Hi, I've compiled Emacs 21.2 with gcc 3.2 on Solaris 8 and specified LDFLAGS="-Wl,-zcombreloc". That's a linker flag which asks for some optimizations, so the start-up will be faster. With that in place, "emacs -batch" works, but starting Emacs without that option ends in SIGSEGV. The problem is that the stuff in unexelf.c doesn't know how to handle a single combined relocation section. I could try to make it work, but the code is messy and I rather wouldn't. A simple and elegant solution is to use Solaris dldump() function, like this: #include #include #include int unexec (char *new_name, char *old_name, unsigned int data_start, unsigned int bss_start, unsigned int entry_address) { if (dldump (0, new_name, RTLD_MEMORY)) { fprintf (stderr, "unexec(): dldump(%s): %s\n", new_name, dlerror()); exit(1); } return 0; } With that in place everything works perfectly. You just need to add a configure check for dldump() (it can be accessed on Solaris by linking in libdl). -- .-. .-. I don't work here. I'm a consultant. (_ \ / _) | dave@willfork.com |