嵌入式Linux系统移植(二)——交叉编译工具集

常用工具:readelf、size、nm、strip、strings、objdump、objcopy、addr2line

readelf:读可执行文件的elf头

 1 ELF Header:
 2   Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
 3   Class:                             ELF32
 4   Data:                              2's complement, little endian
 5   Version:                           1 (current)
 6   OS/ABI:                            UNIX - System V
 7   ABI Version:                       0
 8   Type:                              DYN (Shared object file)
 9   Machine:                           ARM
10   Version:                           0x1
11   Entry point address:               0x34800000
12   Start of program headers:          52 (bytes into file)
13   Start of section headers:          729812 (bytes into file)
14   Flags:                             0x5000002, has entry point, Version5 EABI
15   Size of this header:               52 (bytes)
16   Size of program headers:           32 (bytes)
17   Number of program headers:         3
18   Size of section headers:           40 (bytes)
19   Number of section headers:         25
20   Section header string table index: 22
readelf

 size:读取可执行程序的大小

binge@ubuntu14:~/user/my_share/u-boot-2012.10$ size u-boot
text	data	bss	dec	hex	filename
149612	3304	8384	161300	27614	u-boot

nm:常用于查看可执行程序的符号列表(便于人去观看与程序执行无关的列表)
T:全局函数标签  t:被static修饰的函数区间  D:全局变量区  d:局部变量区被static修饰 
strip:剔除符号列表
strings:查看可执行程序中的常量字符串(是否剔除符号表与此命令成功与否无关)
objcopy:剔除可执行文件的头信息
代码调试指令:objdump 、hexdump

反汇编查看文件(输出C源代码和反汇编出来的指令对照的格式)  arm-linux-objdump -S  文件名

在管道中查看:arm-linux-objdump -S 文件名|less

转载于:https://www.cnblogs.com/embeded-linux/p/10505328.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值