c - 如何让 GCC 不生成 endbr64?
问题描述
我的 gcc 版本是 9.3.0
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
根据 gcc 9.3 手册
-mmanual-endbr
仅通过 cf_check 函数
属性在函数入口处插入 ENDBR 指令。当与选项“-fcf-protection=branch”
一起使用以控制函数入口处的 ENDBR 插入时,这很有用。
据我了解,如果我使用以下命令编译一些东西:
gcc -fcf-protection=branch -mmanual-endbr sth.c -o sth
main 函数没有 cf_check 属性,所以 main 入口处应该没有 endbr64。
但事实证明,在入口处仍然有 endbr64。
那么,如何让GCC不生成endbr64呢?
谢谢。
解决方案
推荐阅读
- android - 遇到 BleAlreadyConnectedException 时重新开始读取 onErrorResumeNext 中的数据
- python - Python:如何删除正在写入的文件
- java - 以 adm 用户 Java 运行 Runtime.getRuntime
- python - 如何使用python将数据附加到databricks中的现有文件?
- python - 使用本地证书不再起作用
- python - OneHotEncoder 条带化标头
- javascript - 可以用导航栏和标签打开新窗口吗?
- android - 创建时间线喷气背包组合
- excel - 无法使用 Excel VBA 中的共享邮箱发送电子邮件
- reactjs - 如何在 symfony 项目中集成反应小部件?