summaryrefslogtreecommitdiff
path: root/src/unexmacosx.c
diff options
context:
space:
mode:
authorSteven Tamm <steventamm@mac.com>2002-12-01 06:33:53 +0000
committerSteven Tamm <steventamm@mac.com>2002-12-01 06:33:53 +0000
commit40e6ff959e664a83d3e6fa3f8cfdb66786a9d258 (patch)
tree8f17db9b4098372a2832637d41f07ef7bbb6780a /src/unexmacosx.c
parentb6f85fd7e08a0c30206fa4bbd1e1405b82c1ff6e (diff)
downloademacs-40e6ff959e664a83d3e6fa3f8cfdb66786a9d258.tar.gz
unexmacosx.c: Now corrects the offset in two hints table to allow prebinding
to be redone and allow the executable to be stripped.
Diffstat (limited to 'src/unexmacosx.c')
-rw-r--r--src/unexmacosx.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index d9c91e5abb0..03aafd2912a 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -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;