--- src/ld/HeaderAndLoadCommands.hpp +++ src/ld/HeaderAndLoadCommands.hpp @@ -1106,7 +1106,7 @@ uint8_t* HeaderAndLoadCommandsAtom::copyThreadsLoadCommand(uint8_t* p) cons template <> uint32_t HeaderAndLoadCommandsAtom::threadLoadCommandSize() const { - return this->alignedSize(16 + x86_THREAD_STATE64_COUNT * 4); + return this->alignedSize(16 + 42*4); // base size + x86_THREAD_STATE64_COUNT * 4 } template <> @@ -1117,8 +1117,8 @@ uint8_t* HeaderAndLoadCommandsAtom::copyThreadsLoadCommand(uint8_t* p) c macho_thread_command

* cmd = (macho_thread_command

*)p; cmd->set_cmd(LC_UNIXTHREAD); cmd->set_cmdsize(threadLoadCommandSize()); - cmd->set_flavor(x86_THREAD_STATE64); - cmd->set_count(x86_THREAD_STATE64_COUNT); + cmd->set_flavor(4); // x86_THREAD_STATE64 + cmd->set_count(42); // x86_THREAD_STATE64_COUNT cmd->set_thread_register(16, start); // rip if ( _options.hasCustomStack() ) cmd->set_thread_register(7, _options.customStackAddr()); // r1