aboutsummaryrefslogtreecommitdiffstats
path: root/src/unexmacosx.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/unexmacosx.c')
-rw-r--r--src/unexmacosx.c41
1 files changed, 39 insertions, 2 deletions
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index 04e3edf463e..2e77d3e17bc 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -1,5 +1,5 @@
1/* Dump Emacs in Mach-O format for use on Mac OS X. 1/* Dump Emacs in Mach-O format for use on Mac OS X.
2 Copyright (C) 2001-2011 Free Software Foundation, Inc. 2 Copyright (C) 2001-2012 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
@@ -478,7 +478,7 @@ find_emacs_zone_regions (void)
478{ 478{
479 num_unexec_regions = 0; 479 num_unexec_regions = 0;
480 480
481 emacs_zone->introspect->enumerator (mach_task_self(), 0, 481 emacs_zone->introspect->enumerator (mach_task_self (), 0,
482 MALLOC_PTR_REGION_RANGE_TYPE 482 MALLOC_PTR_REGION_RANGE_TYPE
483 | MALLOC_ADMIN_REGION_RANGE_TYPE, 483 | MALLOC_ADMIN_REGION_RANGE_TYPE,
484 (vm_address_t) emacs_zone, 484 (vm_address_t) emacs_zone,
@@ -599,6 +599,16 @@ print_load_command_name (int lc)
599 printf ("LC_DYLD_INFO_ONLY"); 599 printf ("LC_DYLD_INFO_ONLY");
600 break; 600 break;
601#endif 601#endif
602#ifdef LC_VERSION_MIN_MACOSX
603 case LC_VERSION_MIN_MACOSX:
604 printf ("LC_VERSION_MIN_MACOSX");
605 break;
606#endif
607#ifdef LC_FUNCTION_STARTS
608 case LC_FUNCTION_STARTS:
609 printf ("LC_FUNCTION_STARTS");
610 break;
611#endif
602 default: 612 default:
603 printf ("unknown "); 613 printf ("unknown ");
604 } 614 }
@@ -1135,6 +1145,28 @@ copy_dyld_info (struct load_command *lc, long delta)
1135} 1145}
1136#endif 1146#endif
1137 1147
1148#ifdef LC_FUNCTION_STARTS
1149/* Copy a LC_FUNCTION_STARTS load command from the input file to the
1150 output file, adjusting the data offset field. */
1151static void
1152copy_linkedit_data (struct load_command *lc, long delta)
1153{
1154 struct linkedit_data_command *ldp = (struct linkedit_data_command *) lc;
1155
1156 if (ldp->dataoff > 0)
1157 ldp->dataoff += delta;
1158
1159 printf ("Writing ");
1160 print_load_command_name (lc->cmd);
1161 printf (" command\n");
1162
1163 if (!unexec_write (curr_header_offset, lc, lc->cmdsize))
1164 unexec_error ("cannot write linkedit data command to header");
1165
1166 curr_header_offset += lc->cmdsize;
1167}
1168#endif
1169
1138/* Copy other kinds of load commands from the input file to the output 1170/* Copy other kinds of load commands from the input file to the output
1139 file, ones that do not require adjustments of file offsets. */ 1171 file, ones that do not require adjustments of file offsets. */
1140static void 1172static void
@@ -1207,6 +1239,11 @@ dump_it (void)
1207 copy_dyld_info (lca[i], linkedit_delta); 1239 copy_dyld_info (lca[i], linkedit_delta);
1208 break; 1240 break;
1209#endif 1241#endif
1242#ifdef LC_FUNCTION_STARTS
1243 case LC_FUNCTION_STARTS:
1244 copy_linkedit_data (lca[i], linkedit_delta);
1245 break;
1246#endif
1210 default: 1247 default:
1211 copy_other (lca[i]); 1248 copy_other (lca[i]);
1212 break; 1249 break;