MH_EXECUTE leave space for thread state command

modified:   p_mach.cpp
This commit is contained in:
John Reiser 2017-12-12 10:53:19 -08:00
parent 3385264eb2
commit 3400ae9dbe

View File

@ -726,7 +726,6 @@ next:
unsigned const sz_threado = threado_size();
mhp->ncmds += 1;
mhp->sizeofcmds += sz_threado;
sz_mach_headers += sz_threado;
fo->seek(0, SEEK_SET);
fo->rewrite(mhp, tail - (char *)mhp);
threado_rewrite(fo);
@ -1359,6 +1358,9 @@ void PackMachBase<T>::pack1(OutputFile *const fo, Filter &/*ft*/) // generate e
}
}
}
unsigned const sz_threado = threado_size();
MemBuffer space(sz_threado); memset(space, 0, sz_threado);
fo->write(space, sz_threado);
sz_mach_headers = fo->getBytesWritten();
}
else if (my_filetype == Mach_header::MH_DYLIB) {