all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: 9927@debbugs.gnu.org
Cc: Peter Dyballa <Peter_Dyballa@Freenet.DE>,
	Samuel Bronson <naesten@gmail.com>
Subject: bug#9927: 24.1.50; unexec/unexmacosx doesn't grok GCC 4.6+ sections
Date: Wed, 17 Sep 2014 11:39:39 -0700	[thread overview]
Message-ID: <5419D56B.3050807@cs.ucla.edu> (raw)
In-Reply-To: <6A5F6D17-397A-48F7-87E9-D77C09B60EC6@Freenet.DE>

[-- Attachment #1: Type: text/plain, Size: 238 bytes --]

If I understand that branch correctly, the attached patch should suffice 
to port to GCC 4.6+ on OS X.  It's relative to trunk bzr 117895.  I 
don't have easy access to OS X to try it, though. Peter and/or Samuel, 
does it work for you?


[-- Attachment #2: gcc4.6.patch --]
[-- Type: text/x-patch, Size: 2219 bytes --]

=== modified file 'src/ChangeLog'
--- src/ChangeLog	2014-09-17 18:27:36 +0000
+++ src/ChangeLog	2014-09-17 18:29:28 +0000
@@ -1,3 +1,7 @@
+2014-09-17  Samuel Bronson  <naesten@gmail.com>
+
+	* unexmacosx.c (copy_data_segment): Port to GCC 4.6+ (Bug#9927).
+
 2014-09-17  Paul Eggert  <eggert@cs.ucla.edu>
 
 	Fix minor problems found by static checking.

=== modified file 'src/unexmacosx.c'
--- src/unexmacosx.c	2014-09-01 02:37:22 +0000
+++ src/unexmacosx.c	2014-09-17 18:28:19 +0000
@@ -879,6 +879,27 @@
 	  if (!unexec_write (header_offset, sectp, sizeof (struct section)))
 	    unexec_error ("cannot write section %.16s's header", sectp->sectname);
 	}
+      else if (strncmp (sectp->sectname, "__bss", 5) == 0
+	       || strncmp (sectp->sectname, "__pu_bss", 8) == 0)
+	{
+	  sectp->flags = S_REGULAR;
+
+	  /* These sections are produced by GCC 4.6+.
+
+	     FIXME: We possibly ought to clear uninitialized local
+	     variables in statically linked libraries like for
+	     SECT_BSS (__bss) above, but setting up the markers we
+	     need in lastfile.c would be rather messy. See
+	     darwin_output_aligned_bss () in gcc/config/darwin.c for
+	     the root of the problem, keeping in mind that the
+	     sections are numbered by their alignment in GCC 4.6, but
+	     by log2(alignment) in GCC 4.7. */
+
+	  if (!unexec_write (sectp->offset, (void *) sectp->addr, sectp->size))
+	    unexec_error ("cannot copy section %.16s", sectp->sectname);
+	  if (!unexec_write (header_offset, sectp, sizeof (struct section)))
+	    unexec_error ("cannot write section %.16s's header", sectp->sectname);
+	}
       else if (strncmp (sectp->sectname, "__la_symbol_ptr", 16) == 0
 	       || strncmp (sectp->sectname, "__nl_symbol_ptr", 16) == 0
 	       || strncmp (sectp->sectname, "__got", 16) == 0
@@ -890,6 +911,7 @@
 	       || strncmp (sectp->sectname, "__program_vars", 16) == 0
 	       || strncmp (sectp->sectname, "__mod_init_func", 16) == 0
 	       || strncmp (sectp->sectname, "__mod_term_func", 16) == 0
+	       || strncmp (sectp->sectname, "__static_data", 16) == 0
 	       || strncmp (sectp->sectname, "__objc_", 7) == 0)
 	{
 	  if (!unexec_copy (sectp->offset, old_file_offset, sectp->size))


  parent reply	other threads:[~2014-09-17 18:39 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-01  0:24 bug#9927: 24.0.90; unexec/unexmacosx fails with GCC 4.6.1 on intel Mac OS X 10.6.8 Peter Dyballa
     [not found] ` <handler.9927.B.132010738317348.ack@debbugs.gnu.org>
2012-04-17  9:17   ` bug#9927: Acknowledgement (24.0.90; unexec/unexmacosx fails with GCC 4.6.1 on intel Mac OS X 10.6.8) Peter Dyballa
2012-06-29 17:03 ` bug#9927: 24.0.90; unexec/unexmacosx fails with GCC 4.6.1 Samuel Bronson
2012-06-29 19:19   ` Peter Dyballa
2012-06-30 16:47   ` Samuel Bronson
2013-07-25 19:37     ` Glenn Morris
2014-08-09 17:05 ` bug#9927: 24.1.50; unexec/unexmacosx doesn't grok GCC 4.6+ sections Stefan Monnier
2014-08-11  1:20   ` Glenn Morris
2014-08-11  1:40   ` Samuel Bronson
2014-08-11  1:56     ` Glenn Morris
2014-09-17 18:39 ` Paul Eggert [this message]
2014-09-17 19:48   ` Glenn Morris
2014-09-17 19:59     ` Paul Eggert
2014-09-17 21:00   ` Peter Dyballa
2014-09-17 21:10     ` Paul Eggert
2014-09-18  2:37       ` Stefan Monnier
2014-09-18  5:27         ` Paul Eggert
2014-09-18 13:05           ` Stefan Monnier
2014-10-04  9:02           ` Peter Dyballa
2014-10-04 17:19             ` Paul Eggert
2014-10-04 18:18               ` Glenn Morris
2014-10-04 19:43                 ` Paul Eggert
2014-10-05 18:36               ` Peter Dyballa
2014-10-05 23:19                 ` Paul Eggert
2014-10-06  1:29                   ` Stefan Monnier
2014-10-06  2:47                     ` Paul Eggert
2014-10-06 13:15                       ` Stefan Monnier
2014-10-06 16:16           ` Peter Dyballa
2014-09-17 22:20   ` Peter Dyballa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5419D56B.3050807@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=9927@debbugs.gnu.org \
    --cc=Peter_Dyballa@Freenet.DE \
    --cc=naesten@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.