]> git.eshelyaron.com Git - emacs.git/commitdiff
unexmacosx.c: Now corrects the offset in two hints table to allow prebinding
authorSteven Tamm <steventamm@mac.com>
Sun, 1 Dec 2002 06:33:53 +0000 (06:33 +0000)
committerSteven Tamm <steventamm@mac.com>
Sun, 1 Dec 2002 06:33:53 +0000 (06:33 +0000)
to be redone and allow the executable to be stripped.

src/ChangeLog
src/unexmacosx.c

index f48bed6deb262d3bffd391b3a7dff67f102a2cc0..3275ca3759db3e69b58b6a617a4a92a8cb1da3b4 100644 (file)
@@ -1,3 +1,9 @@
+2002-12-01  Steven Tamm  <steventamm@mac.com>
+
+       * unexmacosx.c (copy_twolevelhints, dump_it):  Now corrects the
+       offset in two hints table to allow prebinding to be redone and
+       allow the executable to be stripped.
+
 2002-11-29  Dave Love  <fx@gnu.org>
 
        * fns.c (Frequire): Don't call LOADHIST_ATTACH if feature was
index d9c91e5abb0ba4f0774ec8aa37c45064cfc0f8e6..03aafd2912a8e1825427cd11fb5eebb9749f9eff 100644 (file)
@@ -753,6 +753,25 @@ copy_dysymtab (struct load_command *lc)
   curr_header_offset += lc->cmdsize;
 }
 
+/* Copy a LC_TWOLEVEL_HINTS load command from the input file to the output
+   file, adjusting the file offset fields.  */
+static void
+copy_twolevelhints (struct load_command *lc)
+{
+  struct twolevel_hints_command *tlhp = (struct twolevel_hints_command *) lc;
+
+  if (tlhp->nhints > 0) {
+    tlhp->offset += delta;
+  }
+
+  printf ("Writing LC_TWOLEVEL_HINTS command\n");
+
+  if (!unexec_write (curr_header_offset, lc, lc->cmdsize))
+    unexec_error ("cannot write two level hint command to header");
+
+  curr_header_offset += lc->cmdsize;
+}
+
 /* 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
@@ -799,6 +818,9 @@ dump_it ()
       case LC_DYSYMTAB:
        copy_dysymtab (lca[i]);
        break;
+      case LC_TWOLEVEL_HINTS:
+       copy_twolevelhints (lca[i]);
+       break;
       default:
        copy_other (lca[i]);
        break;