1

gcc 文档

可能需要对返回值进行额外的后处理,请参阅__builtin_extract_return_addr

返回地址在内存中的存储表示可能与返回的地址不同__builtin_return_address。例如,在 AArch64 上,存储的地址可能会被返回地址签名破坏,而返回的地址__builtin_return_address则不会。

返回地址的存储表示形式是什么?

__builtin_extract_return_addr

返回的地址__builtin_return_address可能必须通过这个函数来获取实际的编码地址。例如,在 31 位 S/390 平台上,最高位必须被屏蔽,或者在 SPARC 平台上,必须添加偏移量才能执行真正的下一条指令。

如果不需要修复,此函数只需通过 addr。

实际的编码地址是什么?

这是否意味着__builtin_return_address返回地址以某种方式为 CPU 编码?并__builtin_extract_return_addr(__builtin_return_address(0))返回直接(没有任何编码)实际(没有任何班次)返回地址?

如果是这样,为什么有人需要使用__builtin_return_addresswithout __builtin_extract_return_addr


我只想找出哪个函数调用了我的函数。我有使用nm实用程序获得的所有函数的地址。返回的地址nm和返回的地址__builtin_extract_return_addr(__builtin_return_address(0))是否编码相同?

4

0 回答 0