# HG changeset patch # User Steven Tamm # Date 1038724433 0 # Node ID 87aa7494d1dac2f31dd3b5742296a6fc899855ef # Parent a3fe4bde49d3d2ccbd50028159299d5ee0ef1786 unexmacosx.c: Now corrects the offset in two hints table to allow prebinding to be redone and allow the executable to be stripped. diff -r a3fe4bde49d3 -r 87aa7494d1da src/ChangeLog --- a/src/ChangeLog Sat Nov 30 23:43:51 2002 +0000 +++ b/src/ChangeLog Sun Dec 01 06:33:53 2002 +0000 @@ -1,3 +1,9 @@ +2002-12-01 Steven Tamm + + * 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 * fns.c (Frequire): Don't call LOADHIST_ATTACH if feature was diff -r a3fe4bde49d3 -r 87aa7494d1da src/unexmacosx.c --- a/src/unexmacosx.c Sat Nov 30 23:43:51 2002 +0000 +++ b/src/unexmacosx.c Sun Dec 01 06:33:53 2002 +0000 @@ -753,6 +753,25 @@ 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 @@ case LC_DYSYMTAB: copy_dysymtab (lca[i]); break; + case LC_TWOLEVEL_HINTS: + copy_twolevelhints (lca[i]); + break; default: copy_other (lca[i]); break;