emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 r117635: * src/unexmacosx.c (copy_data_segment):


From: Glenn Morris
Subject: [Emacs-diffs] emacs-24 r117635: * src/unexmacosx.c (copy_data_segment): Port to GCC 4.6+ (backport)
Date: Thu, 30 Oct 2014 05:31:17 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117635
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/9927
author: Samuel Bronson <address@hidden>
committer: Glenn Morris <address@hidden>
branch nick: emacs-24
timestamp: Wed 2014-10-29 22:31:12 -0700
message:
  * src/unexmacosx.c (copy_data_segment): Port to GCC 4.6+ (backport)
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/unexmacosx.c               
unexmacosx.c-20091113204419-o5vbwnq5f7feedwu-2413
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-10-28 17:48:21 +0000
+++ b/src/ChangeLog     2014-10-30 05:31:12 +0000
@@ -1,3 +1,7 @@
+2014-10-30  Samuel Bronson  <address@hidden>
+
+       * unexmacosx.c (copy_data_segment): Port to GCC 4.6+ (Bug#9927).
+
 2014-10-28  Eli Zaretskii  <address@hidden>
 
        * fileio.c (Fexpand_file_name): Use make_unibyte_string, not

=== modified file 'src/unexmacosx.c'
--- a/src/unexmacosx.c  2014-09-21 20:35:22 +0000
+++ b/src/unexmacosx.c  2014-10-30 05:31:12 +0000
@@ -881,6 +881,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
@@ -892,6 +913,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))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]