1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

MacOS BigSur wants no MH_DYLDLINK for our MH_EXECUTE

https://github.com/upx/upx/issues/434
	modified:   p_mach.cpp
This commit is contained in:
John Reiser 2021-02-14 13:23:19 -08:00 committed by Markus F.X.J. Oberhumer
parent 801618740c
commit 1ab6e01de2

View File

@ -1194,7 +1194,11 @@ void PackMachBase<T>::pack1(OutputFile *const fo, Filter &/*ft*/) // generate e
mhdro = mhdri;
if (my_filetype==Mach_header::MH_EXECUTE) {
memcpy(&mhdro, stub_main, sizeof(mhdro));
mhdro.flags = mhdri.flags;
mhdro.flags = mhdri.flags & ~(
Mach_header::MH_DYLDLINK // no dyld at this time
| Mach_header::MH_TWOLEVEL // dyld-specific
| Mach_header::MH_BINDATLOAD // dyld-specific
);
COMPILE_TIME_ASSERT(sizeof(mhdro.flags) == sizeof(unsigned))
}
unsigned pos = sizeof(mhdro);