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

指定elf文件dwarf 版本以及查看dwarf版本号

背景

        在实际项目开发过程中,为了让低版本的CANape 工具识别elf 文件,需要在编译elf文件时,指定dwarf的版本。

使用方法:

需要再CMakeLists.txt中指定dwarf 版本

add_compile_options(-g -gdwarf-2) #-gdwarf-4

验证:

readelf --debug-dump=info ./hello.elf | grep -i 'dwarf\|version'
➜  bin git:(main) ✗ readelf --debug-dump=info ./hello.elf | grep -i 'dwarf\|version'Version:       2<d>   DW_AT_producer    : (indirect string, offset: 0x135f9): GNU C++17 11.4.0 -mtune=generic -march=x86-64 -g -g -gdwarf-2 -fasynchronous-unwind-tables -fstack-protector-strong -fstack-clash-protection -fcf-protectionVersion:       2<1e16b>   DW_AT_producer    : (indirect string, offset: 0x135f9): GNU C++17 11.4.0 -mtune=generic -march=x86-64 -g -g -gdwarf-2 -fasynchronous-unwind-tables -fstack-protector-strong -fstack-clash-protection -fcf-protectionVersion:       2<1e249>   DW_AT_producer    : (indirect string, offset: 0x135f9): GNU C++17 11.4.0 -mtune=generic -march=x86-64 -g -g -gdwarf-2 -fasynchronous-unwind-tables -fstack-protector-strong -fstack-clash-protection -fcf-protection

http://www.lryc.cn/news/2378611.html

相关文章:

  • Fidder基本操作
  • 项目管理进阶:精读 78页华为项目管理高级培训教材【附全文阅读】
  • [Java] 方法和数组
  • 微软家各种copilot的AI产品:Github copilot、Microsoft copilot
  • KL散度 (Kullback-Leibler Divergence)
  • 深入解析:java.sql.SQLException: No operations allowed after statement closed 报错
  • DAY 23 训练
  • wordcount程序
  • 回溯法理论基础 LeetCode 77. 组合 LeetCode 216.组合总和III LeetCode 17.电话号码的字母组合
  • 【进程控制二】进程替换和bash解释器
  • 线性回归策略
  • Linux下的c/c++开发之操作Redis数据库
  • Bitmap、Roaring Bitmap、HyperLogLog对比介绍
  • JavaScript 的编译与执行原理
  • fastapi项目中数据流转架构设计规范
  • NHANES指标推荐:FMI
  • 【JDBC】JDBC常见错误处理方法及驱动的加载
  • React中useState中更新是同步的还是异步的?
  • Vim编辑器命令模式操作指南
  • 车载以太网驱动智能化:域控架构设计与开发实践
  • 如何利用技术手段提升小学数学练习效率
  • C# DataGrid功能总览
  • BGP路由策略 基础实验
  • 第9讲、深入理解Scaled Dot-Product Attention
  • 2025B难题练习
  • 双向长短期记忆网络-BiLSTM
  • MySQL UPDATE 执行流程全解析
  • 亚马逊云科技:开启数字化转型的无限可能
  • Gartner《How to Leverage Lakehouse Design in Your DataStrategy》学习心得
  • 【实测有效】Edge浏览器打开部分pdf文件显示空白