gpt4 book ai didi

clang - clang 编译器中的堆栈保护等价物?

转载 作者:行者123 更新时间:2023-12-01 08:26:26 29 4
gpt4 key购买 nike

大多数成熟的编译器似乎对堆栈变量破坏有很好的支持。

对于 clang,我找到了 -fsanitize=safe-stack ,但它不支持共享库,这对我来说几乎没用。

sanitizer 似乎是作为附加组件实现的?有人知道 clang 是否有任何类型的替代(内置?)反堆栈粉碎支持没有共享库限制,或者是否有计划推广现有的有限安全堆栈实现以 catch 所有其他编译器?

最佳答案

clang 支持 gcc 的 -fstack-protector 选项:

:: clang --help | grep stack-protector
-fno-stack-protector Disable the use of stack protectors
-fstack-protector-all Force the usage of stack protectors for all functions
-fstack-protector-strong
-fstack-protector Enable stack protectors for functions potentially vulnerable to stack smashing

我相信它遵循 GCC 在这里所做的。

关于clang - clang 编译器中的堆栈保护等价物?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39371514/

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