GCC编译C / C ++最强化的选项是什么?

编程入门 行业动态 更新时间:2024-10-27 08:34:50
本文介绍了GCC编译C / C ++最强化的选项是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

什么样的GCC选项可以提供最佳的防范内存损坏漏洞,例如缓冲区溢出和悬挂指针? GCC是否提供任何类型的ROP链缓解?是否有性能问题或其他问题妨碍GCC选项在生产中的任务关键应用程序上运行?

我正在查看 Debian Hardening Guide 以及 GCC Mudflap 。以下是我正在考虑的配置:

-D_FORTIFY_SOURCE = 2 -fstack-protector --param ssp- buffer-size = 4 -fPIE -pie -Wl,-z,relro,-z,now(ld -z relro和ld -z now)

是否可以对这组选项进行任何改进?假设最新版本的GCC,如果你知道任何酷炫的即将推出的功能,请告诉我! 解决方案

不是GCC选项,但与GCC兼容。请参阅我们的 CheckPointer 工具,该工具可检测大多数内存管理错误。

执行速度显着放缓;该工具必须跟踪指针和分配存储的有效性,并增加开销。

What set of GCC options provide the best protection against memory corruption vulnerabilities such as Buffer Overflows, and Dangling Pointers? Does GCC provide any type of ROP chain mitigation? Are there performance concerns or other issues that would prevent this GCC option from being on a mission critical application in production?

I am looking at the Debian Hardening Guide as well as GCC Mudflap. Here are the following configurations I am considering:

-D_FORTIFY_SOURCE=2 -fstack-protector --param ssp-buffer-size=4 -fPIE -pie -Wl,-z,relro,-z,now (ld -z relro and ld -z now)

Are there any improvments that can be made to this set of options? Assume the most recent version of GCC, if you know of any cool upcoming feature, let me know!

解决方案

Not a GCC option, but compatible with GCC. See our CheckPointer tool, that detects most memory management errors.

There is a significant slowdown in execution; the tool has to track the validity of pointers and allocated storage, and that adds overhead.

更多推荐

GCC编译C / C ++最强化的选项是什么?

本文发布于:2023-11-10 06:41:51,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:选项   GCC

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!