emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r100615: Support LC_FUNCTION_START


From: YAMAMOTO Mitsuharu
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r100615: Support LC_FUNCTION_STARTS load command on Darwin.
Date: Sat, 23 Jul 2011 13:04:58 +0900
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 100615
committer: YAMAMOTO Mitsuharu <address@hidden>
branch nick: emacs-23
timestamp: Sat 2011-07-23 13:04:58 +0900
message:
  Support LC_FUNCTION_STARTS load command on Darwin.
modified:
  src/ChangeLog
  src/unexmacosx.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2011-07-22 15:23:10 +0000
+++ b/src/ChangeLog     2011-07-23 04:04:58 +0000
@@ -1,3 +1,10 @@
+2011-07-23  YAMAMOTO Mitsuharu  <address@hidden>
+
+       * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
+       and LC_VERSION_MIN_MACOSX.
+       (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
+       (dump_it) [LC_FUNCTION_STARTS]: Use it.
+
 2011-07-22  Chong Yidong  <address@hidden>
 
        * frame.c (Fmodify_frame_parameters): In tty case, update the

=== modified file 'src/unexmacosx.c'
--- a/src/unexmacosx.c  2011-03-11 01:43:49 +0000
+++ b/src/unexmacosx.c  2011-07-23 04:04:58 +0000
@@ -590,6 +590,16 @@
       printf ("LC_DYLD_INFO_ONLY");
       break;
 #endif
+#ifdef LC_VERSION_MIN_MACOSX
+    case LC_VERSION_MIN_MACOSX:
+      printf ("LC_VERSION_MIN_MACOSX");
+      break;
+#endif
+#ifdef LC_FUNCTION_STARTS
+    case LC_FUNCTION_STARTS:
+      printf ("LC_FUNCTION_STARTS");
+      break;
+#endif
     default:
       printf ("unknown          ");
     }
@@ -1126,6 +1136,28 @@
 }
 #endif
 
+#ifdef LC_FUNCTION_STARTS
+/* Copy a LC_FUNCTION_STARTS load command from the input file to the
+   output file, adjusting the data offset field.  */
+static void
+copy_linkedit_data (struct load_command *lc, long delta)
+{
+  struct linkedit_data_command *ldp = (struct linkedit_data_command *) lc;
+
+  if (ldp->dataoff > 0)
+    ldp->dataoff += delta;
+
+  printf ("Writing ");
+  print_load_command_name (lc->cmd);
+  printf (" command\n");
+
+  if (!unexec_write (curr_header_offset, lc, lc->cmdsize))
+    unexec_error ("cannot write linkedit data command to header");
+
+  curr_header_offset += lc->cmdsize;
+}
+#endif
+
 /* Copy other kinds of load commands from the input file to the output
    file, ones that do not require adjustments of file offsets.  */
 static void
@@ -1198,6 +1230,11 @@
        copy_dyld_info (lca[i], linkedit_delta);
        break;
 #endif
+#ifdef LC_FUNCTION_STARTS
+      case LC_FUNCTION_STARTS:
+       copy_linkedit_data (lca[i], linkedit_delta);
+       break;
+#endif
       default:
        copy_other (lca[i]);
        break;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]