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

指定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.xdnf.cn/news/6921.html

相关文章:

  • C++ 蓝桥 STEMA 真题模拟测试卷二
  • 程序中断方式好题分享
  • 日志系统**
  • 蓝桥杯11届国B 答疑
  • Redis内存管理深度解析
  • LeetCode --- 156双周赛
  • JAVA的常见API文档(上)
  • 高频面试题(含笔试高频算法整理)基本总结回顾110
  • 角点特征:从传统算法到深度学习算法演进
  • 电子电路:什么是色环电阻器,怎么识别和计算阻值?
  • React学习(二)-变量
  • Docker常见命令解读
  • Vue.js---watch 的实现原理
  • SpringSecurity授权、认证
  • 数据库blog1_信息(数据)的处理与效率提升
  • Java 应用如何实现 HTTPS:加密数据传输的实用指南
  • liunx常用命令总结
  • RT Thread FinSH(msh)调度逻辑
  • mysql中4种扫描方式和聚簇索引非聚簇索引【爽文一篇】
  • 2025年EB SCI2区TOP,多策略改进黑翅鸢算法MBKA+空调系统RC参数辨识与负载聚合分析,深度解析+性能实测
  • Java面向对象基础学习笔记
  • Kafka 生产者工作流程详解
  • RAG与微调:企业知识库落地的技术选型
  • Axure元件动作四:设置选中
  • 【RabbitMQ】整合 SpringBoot,实现工作队列、发布/订阅、路由和通配符模式
  • Vue.js 教学第三章:模板语法精讲,插值与 v-bind 指令
  • 养生精要:五大维度打造健康生活
  • day33-网络编程
  • java中的运算符
  • C/C++之内存管理