aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Bronson2014-09-17 12:58:31 -0700
committerPaul Eggert2014-09-17 12:58:31 -0700
commit5db525e40007b1f0e7f8f6cee070c515c7f6ff11 (patch)
tree9d2ec01b4cfc83fda6605719099c8f60d9af11de /src
parent9356a87288edd2380ce27cd9775046675cd26f8c (diff)
downloademacs-5db525e40007b1f0e7f8f6cee070c515c7f6ff11.tar.gz
emacs-5db525e40007b1f0e7f8f6cee070c515c7f6ff11.zip
* unexmacosx.c (copy_data_segment): Port to GCC 4.6+.
Fixes: debbugs:9927
Diffstat (limited to 'src')
-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 0b53c80d9e1..ff9e6e5778d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
12014-09-17 Samuel Bronson <naesten@gmail.com>
2
3 * unexmacosx.c (copy_data_segment): Port to GCC 4.6+ (Bug#9927).
4
12014-09-17 Paul Eggert <eggert@cs.ucla.edu> 52014-09-17 Paul Eggert <eggert@cs.ucla.edu>
2 6
3 Fix minor problems found by static checking. 7 Fix minor problems found by static checking.
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index ae34237a66b..940cbfacb10 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -879,6 +879,27 @@ copy_data_segment (struct load_command *lc)
879 if (!unexec_write (header_offset, sectp, sizeof (struct section))) 879 if (!unexec_write (header_offset, sectp, sizeof (struct section)))
880 unexec_error ("cannot write section %.16s's header", sectp->sectname); 880 unexec_error ("cannot write section %.16s's header", sectp->sectname);
881 } 881 }
882 else if (strncmp (sectp->sectname, "__bss", 5) == 0
883 || strncmp (sectp->sectname, "__pu_bss", 8) == 0)
884 {
885 sectp->flags = S_REGULAR;
886
887 /* These sections are produced by GCC 4.6+.
888
889 FIXME: We possibly ought to clear uninitialized local
890 variables in statically linked libraries like for
891 SECT_BSS (__bss) above, but setting up the markers we
892 need in lastfile.c would be rather messy. See
893 darwin_output_aligned_bss () in gcc/config/darwin.c for
894 the root of the problem, keeping in mind that the
895 sections are numbered by their alignment in GCC 4.6, but
896 by log2(alignment) in GCC 4.7. */
897
898 if (!unexec_write (sectp->offset, (void *) sectp->addr, sectp->size))
899 unexec_error ("cannot copy section %.16s", sectp->sectname);
900 if (!unexec_write (header_offset, sectp, sizeof (struct section)))
901 unexec_error ("cannot write section %.16s's header", sectp->sectname);
902 }
882 else if (strncmp (sectp->sectname, "__la_symbol_ptr", 16) == 0 903 else if (strncmp (sectp->sectname, "__la_symbol_ptr", 16) == 0
883 || strncmp (sectp->sectname, "__nl_symbol_ptr", 16) == 0 904 || strncmp (sectp->sectname, "__nl_symbol_ptr", 16) == 0
884 || strncmp (sectp->sectname, "__got", 16) == 0 905 || strncmp (sectp->sectname, "__got", 16) == 0
@@ -890,6 +911,7 @@ copy_data_segment (struct load_command *lc)
890 || strncmp (sectp->sectname, "__program_vars", 16) == 0 911 || strncmp (sectp->sectname, "__program_vars", 16) == 0
891 || strncmp (sectp->sectname, "__mod_init_func", 16) == 0 912 || strncmp (sectp->sectname, "__mod_init_func", 16) == 0
892 || strncmp (sectp->sectname, "__mod_term_func", 16) == 0 913 || strncmp (sectp->sectname, "__mod_term_func", 16) == 0
914 || strncmp (sectp->sectname, "__static_data", 16) == 0
893 || strncmp (sectp->sectname, "__objc_", 7) == 0) 915 || strncmp (sectp->sectname, "__objc_", 7) == 0)
894 { 916 {
895 if (!unexec_copy (sectp->offset, old_file_offset, sectp->size)) 917 if (!unexec_copy (sectp->offset, old_file_offset, sectp->size))