__asm__ volatile( "mov x0, %[testClassAddr]\n" "mov x1, %[pShareInstanceStr]\n" "mov x21, %[objecMsgSendStubAddr]\n" "BLR x21\n" "mov %[test_object],x0\n" :[test_object]"=r"(test_object) : [testClassAddr]"r"(testClassAddr),[pShareInstanceStr]"r"(pShareInstanceStr),[objecMsgSendStubAddr]"r"(objecMsgSendStubAddr) :"x0","x1","x21" );
直接崩溃
*** NSForwarding: warning: selector (0x105c81057) for message ‘shareInstance’ does not match selector known to Objective C runtime (0x196ac5910)-- abort
+[Test shareInstance]: unrecognized selector sent to class 0x104898eb0
其实就是调用 +[Test shareInstance] 函数
x0的地址肯定是正确 x0是类 Test的指针 shareInstance也是实现的
我的实现方法可能有问题 新手求指教