aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Bronson2014-10-29 22:31:12 -0700
committerGlenn Morris2014-10-29 22:31:12 -0700
commitfda2bc46a80aa8c9e2742f6ca149969664c79dc7 (patch)
tree97111d258a5bf416ad7829a3b4b26b819a7d0c47
parent237bf45a48999d5a8a3617822dddf3ea305bc269 (diff)
downloademacs-fda2bc46a80aa8c9e2742f6ca149969664c79dc7.tar.gz
emacs-fda2bc46a80aa8c9e2742f6ca149969664c79dc7.zip
* src/unexmacosx.c (copy_data_segment): Port to GCC 4.6+ (backport)
Fixes: debbugs:9927
-rw-r--r--src/ChangeLog4
-rw-r--r--src/unexmacosx.c22
2 files changed, 26 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 33ee723fe66..1fb2c7b00a1 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
12014-10-30 Samuel Bronson <naesten@gmail.com>
2
3 * unexmacosx.c (copy_data_segment): Port to GCC 4.6+ (Bug#9927).
4
12014-10-28 Eli Zaretskii <eliz@gnu.org> 52014-10-28 Eli Zaretskii <eliz@gnu.org>
2 6
3 * fileio.c (Fexpand_file_name): Use make_unibyte_string, not 7 * fileio.c (Fexpand_file_name): Use make_unibyte_string, not
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index 7d4762fdab2..2a045aa12f8 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -881,6 +881,27 @@ copy_data_segment (struct load_command *lc)
881 if (!unexec_write (header_offset, sectp, sizeof (struct section))) 881 if (!unexec_write (header_offset, sectp, sizeof (struct section)))
882 unexec_error ("cannot write section %.16s's header", sectp->sectname); 882 unexec_error ("cannot write section %.16s's header", sectp->sectname);
883 } 883 }
884 else if (strncmp (sectp->sectname, "__bss", 5) == 0
885 || strncmp (sectp->sectname, "__pu_bss", 8) == 0)
886 {
887 sectp->flags = S_REGULAR;
888
889 /* These sections are produced by GCC 4.6+.
890
891 FIXME: We possibly ought to clear uninitialized local
892 variables in statically linked libraries like for
893 SECT_BSS (__bss) above, but setting up the markers we
894 need in lastfile.c would be rather messy. See
895 darwin_output_aligned_bss () in gcc/config/darwin.c for
896 the root of the problem, keeping in mind that the
897 sections are numbered by their alignment in GCC 4.6, but
898 by log2(alignment) in GCC 4.7. */
899
900 if (!unexec_write (sectp->offset, (void *) sectp->addr, sectp->size))
901 unexec_error ("cannot copy section %.16s", sectp->sectname);
902 if (!unexec_write (header_offset, sectp, sizeof (struct section)))
903 unexec_error ("cannot write section %.16s's header", sectp->sectname);
904 }
884 else if (strncmp (sectp->sectname, "__la_symbol_ptr", 16) == 0 905 else if (strncmp (sectp->sectname, "__la_symbol_ptr", 16) == 0
885 || strncmp (sectp->sectname, "__nl_symbol_ptr", 16) == 0 906 || strncmp (sectp->sectname, "__nl_symbol_ptr", 16) == 0
886 || strncmp (sectp->sectname, "__got", 16) == 0 907 || strncmp (sectp->sectname, "__got", 16) == 0
@@ -892,6 +913,7 @@ copy_data_segment (struct load_command *lc)
892 || strncmp (sectp->sectname, "__program_vars", 16) == 0 913 || strncmp (sectp->sectname, "__program_vars", 16) == 0
893 || strncmp (sectp->sectname, "__mod_init_func", 16) == 0 914 || strncmp (sectp->sectname, "__mod_init_func", 16) == 0
894 || strncmp (sectp->sectname, "__mod_term_func", 16) == 0 915 || strncmp (sectp->sectname, "__mod_term_func", 16) == 0
916 || strncmp (sectp->sectname, "__static_data", 16) == 0
895 || strncmp (sectp->sectname, "__objc_", 7) == 0) 917 || strncmp (sectp->sectname, "__objc_", 7) == 0)
896 { 918 {
897 if (!unexec_copy (sectp->offset, old_file_offset, sectp->size)) 919 if (!unexec_copy (sectp->offset, old_file_offset, sectp->size))