当前位置: 首页 > news >正文

arm非对齐访问编译器选项

gcc编译选项:

-munaligned-access

gcc编译选项:

-mno-unaligned-access  

Enables (or disables) reading and writing of 16- and 32- bit values from addresses that are not 16- or 32- bit aligned. By default unaligned access is disabled for all pre-ARMv6, all ARMv6-M and for ARMv8-M Baseline architectures, and enabled for all other architectures. If unaligned access is not enabled then words in packed data structures are accessed a byte at a time.

The ARM attribute Tag_CPU_unaligned_access is set in the generated object file to either true or false, depending upon the setting of this option. If unaligned access is enabled then the preprocessor symbol __ARM_FEATURE_UNALIGNED is also defined.

默认arm都是aligend-access,然而如果代码里有使用attribute((packed))等参数定义结构体时,会出现结构体成员是pack的也就是非对齐的,此时如果没有使能允许非对齐访问(对结构体成员赋值等操作)会导致abort。

http://www.dtcms.com/a/95728.html

相关文章:

  • vue(1-45)
  • GitHub美化个人主页3D图表显示配置操作
  • [力扣每日一练]关于MySQL和pandas的正则表达式应用
  • caddy常用配置
  • torchvision中数据集的使用
  • ros2 humble无法识别头文件<rclcpp/rclcpp.hpp>
  • 科技赋能建筑业变革:中建海龙创新引领高质量发展新路径
  • 深度解读:智能体2.0 AI Agent多推演进
  • 第七章:Python中pygame库的使用:开发小游戏
  • 【Java】注解
  • 单店效率优化促毛利增长,雍禾医疗业绩稳步跑
  • 服装零售行业数据分析方案
  • StarRocks 中 CURRENT_TIMESTAMP 和 current_time 分区过滤问题
  • Ai工作流工具有那些如Dify、coze扣子等以及他们是否开源
  • CF每日5题Day4(1400)
  • 程序员软件工具推荐列表
  • 图解AUTOSAR_SWS_FlashTest
  • 第十章:Pyinstaller库打包Python项目为Windows可执行文件.exe
  • 6-项目负责人-创建项目集
  • 洛谷题单1-B2005 字符三角形-python-流程图重构
  • 【MYSQL】Windows 下 CMD 操作数据库指南
  • 基于TrustZone的嵌入式系统安全隔离设计
  • 【解决】导入PNG图片,转 Sprite 格式成功但资产未生效问题
  • 4.Socket类、InetAddr类、Epoll类实现模块化
  • (二) 深入了解AVFoundation - 播放:AVFoundation 播放基础入门
  • ebay跨境电商账号安全防护:IP污染风险深度解析及应对方案
  • 全新升级 | Built For You Spring ‘25 发布,Fin 智能客服实现新突破!
  • 重试机制之指针退避策略算法
  • 求矩阵某列的和
  • 云钥科技多通道工业相机解决方案设计