aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Schwab2012-05-27 14:18:35 +0200
committerAndreas Schwab2012-05-27 14:18:35 +0200
commitf3dd73121c15514280f6ddd467b00663945b6648 (patch)
treeb17b9dca8fb110b3e855259cdd56b84c7d501c77 /src
parentcd37650917a996c2bda3fdc1aa2955b9cace964f (diff)
downloademacs-f3dd73121c15514280f6ddd467b00663945b6648.tar.gz
emacs-f3dd73121c15514280f6ddd467b00663945b6648.zip
* unexmacosx.c (copy_data_segment): Truncate after 16 characters
when referring to sectname field in printf format.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/unexmacosx.c19
2 files changed, 15 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index b87398fcbc1..264bf1e578c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12012-05-27 Andreas Schwab <schwab@linux-m68k.org>
2
3 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
4 when referring to sectname field in printf format.
5
12012-05-27 Paul Eggert <eggert@cs.ucla.edu> 62012-05-27 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 * lisp.h [REL_ALLOC]: Omit duplicate prototypes. 8 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index 2e77d3e17bc..a61bbd8eb86 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -809,9 +809,9 @@ copy_data_segment (struct load_command *lc)
809 { 809 {
810 sectp->flags = S_REGULAR; 810 sectp->flags = S_REGULAR;
811 if (!unexec_write (sectp->offset, (void *) sectp->addr, sectp->size)) 811 if (!unexec_write (sectp->offset, (void *) sectp->addr, sectp->size))
812 unexec_error ("cannot write section %s", sectp->sectname); 812 unexec_error ("cannot write section %.16s", sectp->sectname);
813 if (!unexec_write (header_offset, sectp, sizeof (struct section))) 813 if (!unexec_write (header_offset, sectp, sizeof (struct section)))
814 unexec_error ("cannot write section %s's header", sectp->sectname); 814 unexec_error ("cannot write section %.16s's header", sectp->sectname);
815 } 815 }
816 else if (strncmp (sectp->sectname, SECT_BSS, 16) == 0) 816 else if (strncmp (sectp->sectname, SECT_BSS, 16) == 0)
817 { 817 {
@@ -829,15 +829,15 @@ copy_data_segment (struct load_command *lc)
829 my_size = (unsigned long)my_endbss_static - sectp->addr; 829 my_size = (unsigned long)my_endbss_static - sectp->addr;
830 if (!(sectp->addr <= (unsigned long)my_endbss_static 830 if (!(sectp->addr <= (unsigned long)my_endbss_static
831 && my_size <= sectp->size)) 831 && my_size <= sectp->size))
832 unexec_error ("my_endbss_static is not in section %s", 832 unexec_error ("my_endbss_static is not in section %.16s",
833 sectp->sectname); 833 sectp->sectname);
834 if (!unexec_write (sectp->offset, (void *) sectp->addr, my_size)) 834 if (!unexec_write (sectp->offset, (void *) sectp->addr, my_size))
835 unexec_error ("cannot write section %s", sectp->sectname); 835 unexec_error ("cannot write section %.16s", sectp->sectname);
836 if (!unexec_write_zero (sectp->offset + my_size, 836 if (!unexec_write_zero (sectp->offset + my_size,
837 sectp->size - my_size)) 837 sectp->size - my_size))
838 unexec_error ("cannot write section %s", sectp->sectname); 838 unexec_error ("cannot write section %.16s", sectp->sectname);
839 if (!unexec_write (header_offset, sectp, sizeof (struct section))) 839 if (!unexec_write (header_offset, sectp, sizeof (struct section)))
840 unexec_error ("cannot write section %s's header", sectp->sectname); 840 unexec_error ("cannot write section %.16s's header", sectp->sectname);
841 } 841 }
842 else if (strncmp (sectp->sectname, "__la_symbol_ptr", 16) == 0 842 else if (strncmp (sectp->sectname, "__la_symbol_ptr", 16) == 0
843 || strncmp (sectp->sectname, "__nl_symbol_ptr", 16) == 0 843 || strncmp (sectp->sectname, "__nl_symbol_ptr", 16) == 0
@@ -851,12 +851,13 @@ copy_data_segment (struct load_command *lc)
851 || strncmp (sectp->sectname, "__objc_", 7) == 0) 851 || strncmp (sectp->sectname, "__objc_", 7) == 0)
852 { 852 {
853 if (!unexec_copy (sectp->offset, old_file_offset, sectp->size)) 853 if (!unexec_copy (sectp->offset, old_file_offset, sectp->size))
854 unexec_error ("cannot copy section %s", sectp->sectname); 854 unexec_error ("cannot copy section %.16s", sectp->sectname);
855 if (!unexec_write (header_offset, sectp, sizeof (struct section))) 855 if (!unexec_write (header_offset, sectp, sizeof (struct section)))
856 unexec_error ("cannot write section %s's header", sectp->sectname); 856 unexec_error ("cannot write section %.16s's header", sectp->sectname);
857 } 857 }
858 else 858 else
859 unexec_error ("unrecognized section name in __DATA segment"); 859 unexec_error ("unrecognized section %.16s in __DATA segment",
860 sectp->sectname);
860 861
861 printf (" section %-16.16s at %#8lx - %#8lx (sz: %#8lx)\n", 862 printf (" section %-16.16s at %#8lx - %#8lx (sz: %#8lx)\n",
862 sectp->sectname, (long) (sectp->offset), 863 sectp->sectname, (long) (sectp->offset),