arm64-to-sim icon indicating copy to clipboard operation
arm64-to-sim copied to clipboard

Handle when "build_version_command.ntools!=0"

Open yongjincho92 opened this issue 2 years ago • 2 comments

Background Previous implementation was not supporting for case when build_version_command.ntools != 0 because ntools was hardcoded to 0.

Changes Based on how MachO files are loaded in dyld (attached below)

case LC_BUILD_VERSION:
    if ( cmd->cmdsize != (sizeof(build_version_command) + ((build_version_command*)cmd)->ntools * sizeof(build_tool_version)) )
        diag.error("LC_BUILD_VERSION load command size wrong");
    else if ( hasMinVersion )
        diag.error("LC_BUILD_VERSION cannot coexist LC_VERSION_MIN_* with load commands");
    break;

Add a similar logic into function updateVersionMin.

yongjincho92 avatar Jun 05 '22 20:06 yongjincho92

@bogo Can you review my change? I am adding a handling of a case when ntools != 0

yongjincho92 avatar Jun 28 '22 22:06 yongjincho92

hey @yongjincho92! so sorry, this completely fell off my plate for a bit. I just merged #18 from @hdooley that was targeting a similar problem, in which ntools was being overwritten - does this solve your problem?

bogo avatar Aug 10 '22 02:08 bogo

@bogo thanks for the fix!

yongjincho92 avatar Mar 15 '23 16:03 yongjincho92