在linux内核源代码中,在tasklet_action代码中添加了这一行:
printk("tasklet_action = %p\n" , *tasklet_action);
printk("tasklet_action = %p\n" , &tasklet_action);
printk("tasklet_action = %p\n" , tasklet_action);
Run Code Online (Sandbox Code Playgroud)
在输出中我得到:
tasklet_action = c03441a1
tasklet_action = c03441a1
tasklet_action = c03441a1
Run Code Online (Sandbox Code Playgroud)
但是当在system.map文件中搜索时,tasklet_action地址就是c03441a0这样,有一个1字节的偏移量.
我经常得到'otool'所示方法的实现地址的1字节偏移量.
例如'otool -o'给出0xe99d5,但'otool -tvV'给出:
+[NSError(SomeCategory) someMethod]:
000e99d4 b590 push {r4, r7, lr}
000e99d6 f6441184 movw r1, 0x4984
000e99da af01 add r7, sp, #4
000e99dc f2c0010a movt r1, 0xa
Run Code Online (Sandbox Code Playgroud)
所以方法从0xe99d4开始.0xe99d5看起来不对,没有对齐.我相信'otool'工作正常,我不了解实施的某些方面.如何解释输出?