currentSegmentInfo->fInitProtection = initprot;
if ( initprot == 0 )
currentSegmentInfo->fMaxProtection = 0; // pagezero should have maxprot==initprot==0
+ else if ( fOptions.architecture() == CPU_TYPE_ARM )
+ currentSegmentInfo->fMaxProtection = currentSegmentInfo->fInitProtection; // iPhoneOS wants max==init
else
currentSegmentInfo->fMaxProtection = VM_PROT_READ | VM_PROT_WRITE | VM_PROT_EXECUTE;
std::vector<Options::SegmentProtect>& customSegProtections = fOptions.customSegmentProtections();
}
else if ( fOptions.makeEncryptable() ) {
// want load commands to end on a page boundary, so __text starts on page boundary
- paddingSize = 4096 - (totalSizeOfHeaderAndLoadCommands % 4096);
+ paddingSize = 4096 - ((totalSizeOfHeaderAndLoadCommands+fOptions.minimumHeaderPad()) % 4096) + fOptions.minimumHeaderPad();
fEncryptionLoadCommand->setStartEncryptionOffset(totalSizeOfHeaderAndLoadCommands+paddingSize);
}
else {