diff options
| author | YAMAMOTO Mitsuharu | 2011-07-23 13:04:58 +0900 |
|---|---|---|
| committer | YAMAMOTO Mitsuharu | 2011-07-23 13:04:58 +0900 |
| commit | 7963fa061a06d3d3c3bd396246fbb17e6aad9f67 (patch) | |
| tree | 771d9a7bbe4637ee90710211d665fac2eb572559 | |
| parent | f7912160c498869e56edc5472b94106fd772fb8d (diff) | |
| download | emacs-7963fa061a06d3d3c3bd396246fbb17e6aad9f67.tar.gz emacs-7963fa061a06d3d3c3bd396246fbb17e6aad9f67.zip | |
Support LC_FUNCTION_STARTS load command on Darwin.
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/unexmacosx.c | 37 |
2 files changed, 44 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 09a6180e79d..62424f794cf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2011-07-23 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 2 | |||
| 3 | * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS | ||
| 4 | and LC_VERSION_MIN_MACOSX. | ||
| 5 | (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function. | ||
| 6 | (dump_it) [LC_FUNCTION_STARTS]: Use it. | ||
| 7 | |||
| 1 | 2011-07-22 Chong Yidong <cyd@stupidchicken.com> | 8 | 2011-07-22 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 9 | ||
| 3 | * frame.c (Fmodify_frame_parameters): In tty case, update the | 10 | * frame.c (Fmodify_frame_parameters): In tty case, update the |
diff --git a/src/unexmacosx.c b/src/unexmacosx.c index d6f170c9127..e4d0314ce8c 100644 --- a/src/unexmacosx.c +++ b/src/unexmacosx.c | |||
| @@ -590,6 +590,16 @@ print_load_command_name (int lc) | |||
| 590 | printf ("LC_DYLD_INFO_ONLY"); | 590 | printf ("LC_DYLD_INFO_ONLY"); |
| 591 | break; | 591 | break; |
| 592 | #endif | 592 | #endif |
| 593 | #ifdef LC_VERSION_MIN_MACOSX | ||
| 594 | case LC_VERSION_MIN_MACOSX: | ||
| 595 | printf ("LC_VERSION_MIN_MACOSX"); | ||
| 596 | break; | ||
| 597 | #endif | ||
| 598 | #ifdef LC_FUNCTION_STARTS | ||
| 599 | case LC_FUNCTION_STARTS: | ||
| 600 | printf ("LC_FUNCTION_STARTS"); | ||
| 601 | break; | ||
| 602 | #endif | ||
| 593 | default: | 603 | default: |
| 594 | printf ("unknown "); | 604 | printf ("unknown "); |
| 595 | } | 605 | } |
| @@ -1126,6 +1136,28 @@ copy_dyld_info (struct load_command *lc, long delta) | |||
| 1126 | } | 1136 | } |
| 1127 | #endif | 1137 | #endif |
| 1128 | 1138 | ||
| 1139 | #ifdef LC_FUNCTION_STARTS | ||
| 1140 | /* Copy a LC_FUNCTION_STARTS load command from the input file to the | ||
| 1141 | output file, adjusting the data offset field. */ | ||
| 1142 | static void | ||
| 1143 | copy_linkedit_data (struct load_command *lc, long delta) | ||
| 1144 | { | ||
| 1145 | struct linkedit_data_command *ldp = (struct linkedit_data_command *) lc; | ||
| 1146 | |||
| 1147 | if (ldp->dataoff > 0) | ||
| 1148 | ldp->dataoff += delta; | ||
| 1149 | |||
| 1150 | printf ("Writing "); | ||
| 1151 | print_load_command_name (lc->cmd); | ||
| 1152 | printf (" command\n"); | ||
| 1153 | |||
| 1154 | if (!unexec_write (curr_header_offset, lc, lc->cmdsize)) | ||
| 1155 | unexec_error ("cannot write linkedit data command to header"); | ||
| 1156 | |||
| 1157 | curr_header_offset += lc->cmdsize; | ||
| 1158 | } | ||
| 1159 | #endif | ||
| 1160 | |||
| 1129 | /* Copy other kinds of load commands from the input file to the output | 1161 | /* Copy other kinds of load commands from the input file to the output |
| 1130 | file, ones that do not require adjustments of file offsets. */ | 1162 | file, ones that do not require adjustments of file offsets. */ |
| 1131 | static void | 1163 | static void |
| @@ -1198,6 +1230,11 @@ dump_it () | |||
| 1198 | copy_dyld_info (lca[i], linkedit_delta); | 1230 | copy_dyld_info (lca[i], linkedit_delta); |
| 1199 | break; | 1231 | break; |
| 1200 | #endif | 1232 | #endif |
| 1233 | #ifdef LC_FUNCTION_STARTS | ||
| 1234 | case LC_FUNCTION_STARTS: | ||
| 1235 | copy_linkedit_data (lca[i], linkedit_delta); | ||
| 1236 | break; | ||
| 1237 | #endif | ||
| 1201 | default: | 1238 | default: |
| 1202 | copy_other (lca[i]); | 1239 | copy_other (lca[i]); |
| 1203 | break; | 1240 | break; |