当前位置:网站首页>map文件粗略分析
map文件粗略分析
2022-07-06 09:17:00 【csdndulala】
https://blog.csdn.net/weixin_30632899/article/details/94867874
Map文件就是MCU程序的Map(地图)。
我们编写好的代码,通过编译链接一系列动作后,会生成一个elf格式的文件,从这个elf文件可以生成一个hex或者bin文件,以供烧录到MCU里面去运行,同时(可配置地)生成一个叫Map的文件。
这个elf文件实际上就包含了程序的各种信息,包括函数名、变量名,地址、大小等等非常丰富的信息。而这个map文件就是从elf提出取来的,非常直观地(以文本形式)展现程序中的各文件包含了哪些函数变量,而这些函数变量分配在哪些段,地址是什么,以及其占用的空间大小等。
map文件包含内容如下:
- Archive member included to satisfy reference by file (symbol)
调用的库函数信息:来自哪个.a中的哪个.o - Allocating common symbols
未初始化的全局变量:大小 变量出处 - Discarded input sections
没有被调用的函数、变量 - Memory Configuration
根据.ld文件中MEMORY来划分的内存区域:名称、起始地址、长度 - Linker script and memory map
链接所需要的.o .a
根据.ld文件中SECTION来划分的区域:
.txt 代码段
.rodata 字符串和局部变量
.srodata 库中用到的rodata
.rela.dyn
.rela.text. 待重定位的函数信息
.data 数据段(大)
.sdata 数据段(小)
.bss 初始化为0的变量(大)
.sbss 初始化为0的变量(小)
COMMON 未初始化的变量
.attributes
.debug_info
.debug_abbrev
.debug_loc
.debug_aranges
.debug_line
.debug_str
.debug_frame
边栏推荐
- 高通&MTK&麒麟 手机平台USB3.0方案对比
- STM32 如何定位导致发生 hard fault 的代码段
- [yarn] CDP cluster yarn configuration capacity scheduler batch allocation
- MySQL realizes read-write separation
- SQL time injection
- open-mmlab labelImg mmdetection
- Kaggle竞赛-Two Sigma Connect: Rental Listing Inquiries(XGBoost)
- Linux yum安装MySQL
- Contiki source code + principle + function + programming + transplantation + drive + network (turn)
- 【CDH】CDH5.16 配置 yarn 任务集中分配设置不生效问题
猜你喜欢
Pytoch Foundation
Pytorch four commonly used optimizer tests
Principle and implementation of MySQL master-slave replication
Characteristics, task status and startup of UCOS III
数据分析之缺失值填充(重点讲解多重插值法Miceforest)
RT thread API reference manual
第4阶段 Mysql数据库
RT-Thread API参考手册
Detailed explanation of Union [C language]
STM32 如何定位导致发生 hard fault 的代码段
随机推荐
[BSidesCF_2020]Had_ a_ bad_ day
5G工作原理详解(解释&图解)
互联网协议详解
Unit test - unittest framework
uCOS-III 的特点、任务状态、启动
Kaggle竞赛-Two Sigma Connect: Rental Listing Inquiries(XGBoost)
[template] KMP string matching
C language callback function [C language]
Comparaison des solutions pour la plate - forme mobile Qualcomm & MTK & Kirin USB 3.0
PyTorch四种常用优化器测试
4、安装部署Spark(Spark on Yarn模式)
The first simple case of GNN: Cora classification
TypeScript
[Presto] Presto parameter configuration optimization
ESP8266通过Arduino IDE连接Onenet云平台(MQTT)
Some concepts often asked in database interview
电商数据分析--薪资预测(线性回归)
Dependency in dependencymanagement cannot be downloaded and red is reported
OPPO VOOC快充电路和协议
Selective sorting and bubble sorting [C language]