【问题标题】:Useless Store and load无用的存储和加载
【发布时间】:2013-11-25 16:23:36
【问题描述】:

在反编译程序中,我遇到了以下指令:

890c:       e50b0008        str     r0, [fp, #-8]
8910:       e50b100c        str     r1, [fp, #-12]
8914:       e51b0008        ldr     r0, [fp, #-8]
8918:       e51b100c        ldr     r1, [fp, #-12]

最后2个ldr的意义何在?

【问题讨论】:

    标签: assembly arm


    【解决方案1】:

    编译器在未完全优化时发出这些。像

    这样的行
    a = 0;
    return a;
    

    当为调试而编译时,看起来有点像。

    Re:comment:在这种情况下,它很可能是一个调用序列

    a = something; //compiler: calculate in register, write out to memory
    b = something_else; //compiler: calculate in register, write out to memory
    Func(a, b); //compiler: pick up from memory, branch and link to the function
    

    【讨论】:

    • 下一条指令是 bl 说明一切。
    【解决方案2】:

    另一种可能是程序正在修改内存映射的 I/O 寄存器。

    【讨论】:

    • IO 映射到 [fp, #-8] ?
    • fp 没有理由不能用作通用寄存器
    猜你喜欢
    • 2016-02-26
    • 1970-01-01
    • 2011-10-18
    • 2013-11-13
    • 2013-06-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-07
    相关资源
    最近更新 更多