gpt4 book ai didi

assembly - x86-64上的红色区域到底在哪里?

转载 作者:行者123 更新时间:2023-12-03 12:15:53 25 4
gpt4 key购买 nike

Wikipedia:

In computing, a red zone is a fixed-size area in a function's stack frame beyond the return address which is not preserved by that function. The callee function may use the red zone for storing local variables without the extra overhead of modifying the stack pointer. This region of memory is not to be modified by interrupt/exception/signal handlers. The x86-64 ABI used by System V mandates a 128-byte red zone, which begins directly after the return address and includes the function's arguments. The OpenRISC toolchain assumes a 128-byte red zone.



the System V x86-64 ABI:

The 128-byte area beyond the location pointed to by %rsp is considered to be reserved and shall not be modified by signal or interrupt handlers. Therefore, functions may use this area for temporary data that is not needed across function calls. In particular, leaf functions may use this area for their entire stack frame, rather than adjusting the stack pointer in the prologue and epilogue. This area is known as the red zone.


  • 给定这两个引号,是上方的红色区域是堆栈的返回地址,还是下方的红色区域是堆栈的返回地址?
  • 由于此红色区域是相对于RSP的,所以它随每个push一起向下移动,是否随每个pop向上移动?
  • 最佳答案

    Given these two quotes, is the red zone above the stacked return address or below the stacked return address?



    红色区域是 rsp下方的128个字节,即 rsp - 128rsp - 1

    Since this red zone is relative to RSP, does it move downward with each push and does it move upward with each pop?



    是。

    关于assembly - x86-64上的红色区域到底在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38042188/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com