相关疑难解决方法(0)

Linux内核 - 为什么System.map中的函数地址是实时看到的地址之前的一个字节?

在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字节的偏移量.

  • 为什么我有这个偏移?
  • 它总是一个字节的偏移量?

c linux arm function-pointers linux-kernel

14
推荐指数
1
解决办法
1713
查看次数

armot7的otool错误的方法实现地址?

我经常得到'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'工作正常,我不了解实施的某些方面.如何解释输出?

assembly arm mach-o objective-c otool

3
推荐指数
1
解决办法
532
查看次数