当前位置: 技术问答>linux和unix
objdump 使用求救
来源: 互联网 发布时间:2016-07-30
本文导语: 输入:objdump -h mybin 输出: Sections: Idx Name Size VMA LMA File off Algn 0 .hash 00000aa8 000000b4 000000b4 000000b4 2**2 CONTENTS, ALLOC, LO...
输入:objdump -h mybin
输出:
Sections:
Idx Name Size VMA LMA File off Algn
0 .hash 00000aa8 000000b4 000000b4 000000b4 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
1 .dynsym 00001a10 00000b5c 00000b5c 00000b5c 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
2 .dynstr 00001b0e 0000256c 0000256c 0000256c 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
3 .gnu.version 00000342 0000407a 0000407a 0000407a 2**1
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 .gnu.version_r 00000020 000043bc 000043bc 000043bc 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
5 .rel.dyn 00000260 000043dc 000043dc 000043dc 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
6 .rel.plt 00000740 0000463c 0000463c 0000463c 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
7 .init 00000010 00004d7c 00004d7c 00004d7c 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
8 .plt 00000af4 00004d8c 00004d8c 00004d8c 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
9 .text 00019f1c 00005880 00005880 00005880 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
10 .fini 0000000c 0001f79c 0001f79c 0001f79c 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
11 .rodata 00004e6c 0001f7a8 0001f7a8 0001f7a8 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
12 .eh_frame 00000004 00024614 00024614 00024614 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
13 .ctors 0000000c 0002d000 0002d000 00025000 2**2
CONTENTS, ALLOC, LOAD, DATA
14 .dtors 0000000c 0002d00c 0002d00c 0002500c 2**2
CONTENTS, ALLOC, LOAD, DATA
15 .jcr 00000004 0002d018 0002d018 00025018 2**2
CONTENTS, ALLOC, LOAD, DATA
16 .dynamic 000000e0 0002d01c 0002d01c 0002501c 2**2
CONTENTS, ALLOC, LOAD, DATA
17 .got 000004cc 0002d0fc 0002d0fc 000250fc 2**2
CONTENTS, ALLOC, LOAD, DATA
18 .data 0000005c 0002d5c8 0002d5c8 000255c8 2**2
CONTENTS, ALLOC, LOAD, DATA
19 .bss 00011464 0002d624 0002d624 00025624 2**2
ALLOC
20 .comment 000004e6 00000000 00000000 00025624 2**0
CONTENTS, READONLY
21 .debug_aranges 00000240 00000000 00000000 00025b0a 2**0
CONTENTS, READONLY, DEBUGGING
22 .debug_pubnames 000013bf 00000000 00000000 00025d4a 2**0
CONTENTS, READONLY, DEBUGGING
23 .debug_info 000295d5 00000000 00000000 00027109 2**0
CONTENTS, READONLY, DEBUGGING
24 .debug_abbrev 00002b4e 00000000 00000000 000506de 2**0
CONTENTS, READONLY, DEBUGGING
25 .debug_line 000034cd 00000000 00000000 0005322c 2**0
CONTENTS, READONLY, DEBUGGING
26 .debug_frame 00001f40 00000000 00000000 000566fc 2**2
CONTENTS, READONLY, DEBUGGING
27 .debug_str 00001ca6 00000000 00000000 0005863c 2**0
CONTENTS, READONLY, DEBUGGING
objdump -h 功能是显示目标文件的section headers
上面打印那么多东西,我看不懂哦。哪位能告知Idx Name Size VMA LMA File off Algn
分别代表什么意思?
还有通过objdump能分析出,程序占用多少内存吗?
权衡一个程序是否占用过多的系统资源,能否常驻内存运行,通过objdump可以有所提示么?
输出:
Sections:
Idx Name Size VMA LMA File off Algn
0 .hash 00000aa8 000000b4 000000b4 000000b4 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
1 .dynsym 00001a10 00000b5c 00000b5c 00000b5c 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
2 .dynstr 00001b0e 0000256c 0000256c 0000256c 2**0
CONTENTS, ALLOC, LOAD, READONLY, DATA
3 .gnu.version 00000342 0000407a 0000407a 0000407a 2**1
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 .gnu.version_r 00000020 000043bc 000043bc 000043bc 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
5 .rel.dyn 00000260 000043dc 000043dc 000043dc 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
6 .rel.plt 00000740 0000463c 0000463c 0000463c 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
7 .init 00000010 00004d7c 00004d7c 00004d7c 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
8 .plt 00000af4 00004d8c 00004d8c 00004d8c 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
9 .text 00019f1c 00005880 00005880 00005880 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
10 .fini 0000000c 0001f79c 0001f79c 0001f79c 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
11 .rodata 00004e6c 0001f7a8 0001f7a8 0001f7a8 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
12 .eh_frame 00000004 00024614 00024614 00024614 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
13 .ctors 0000000c 0002d000 0002d000 00025000 2**2
CONTENTS, ALLOC, LOAD, DATA
14 .dtors 0000000c 0002d00c 0002d00c 0002500c 2**2
CONTENTS, ALLOC, LOAD, DATA
15 .jcr 00000004 0002d018 0002d018 00025018 2**2
CONTENTS, ALLOC, LOAD, DATA
16 .dynamic 000000e0 0002d01c 0002d01c 0002501c 2**2
CONTENTS, ALLOC, LOAD, DATA
17 .got 000004cc 0002d0fc 0002d0fc 000250fc 2**2
CONTENTS, ALLOC, LOAD, DATA
18 .data 0000005c 0002d5c8 0002d5c8 000255c8 2**2
CONTENTS, ALLOC, LOAD, DATA
19 .bss 00011464 0002d624 0002d624 00025624 2**2
ALLOC
20 .comment 000004e6 00000000 00000000 00025624 2**0
CONTENTS, READONLY
21 .debug_aranges 00000240 00000000 00000000 00025b0a 2**0
CONTENTS, READONLY, DEBUGGING
22 .debug_pubnames 000013bf 00000000 00000000 00025d4a 2**0
CONTENTS, READONLY, DEBUGGING
23 .debug_info 000295d5 00000000 00000000 00027109 2**0
CONTENTS, READONLY, DEBUGGING
24 .debug_abbrev 00002b4e 00000000 00000000 000506de 2**0
CONTENTS, READONLY, DEBUGGING
25 .debug_line 000034cd 00000000 00000000 0005322c 2**0
CONTENTS, READONLY, DEBUGGING
26 .debug_frame 00001f40 00000000 00000000 000566fc 2**2
CONTENTS, READONLY, DEBUGGING
27 .debug_str 00001ca6 00000000 00000000 0005863c 2**0
CONTENTS, READONLY, DEBUGGING
objdump -h 功能是显示目标文件的section headers
上面打印那么多东西,我看不懂哦。哪位能告知Idx Name Size VMA LMA File off Algn
分别代表什么意思?
还有通过objdump能分析出,程序占用多少内存吗?
权衡一个程序是否占用过多的系统资源,能否常驻内存运行,通过objdump可以有所提示么?
|
一言难尽(其实是我都看过了但是没有消化好)
推荐lz一本书 嵌入式Linux内存使用与性能优化
解决以上所有问题
推荐lz一本书 嵌入式Linux内存使用与性能优化
解决以上所有问题
|
程序员的自我修养—链接、装载与库
都是国产的好书