百度可知是因为缺少动态库,在PC 执行arm-linux-readlf xxx(应用程序) 打印结果如下:
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: ARM
Version: 0x1
Entry point address: 0x84f4
Start of program headers: 52 (bytes into file)
Start of section headers: 14400 (bytes into file)
Flags: 0x5000002, has entry point, Version5 EABI
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 10
Size of section headers: 40 (bytes)
Number of section headers: 38
Section header string table index: 35
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .interp PROGBITS 00008174 000174 000013 00 A 0 0 1
[ 2] .note.ABI-tag NOTE 00008188 000188 000020 00 A 0 0 4
[ 3] .hash HASH 000081a8 0001a8 000050 04 A 4 0 4
[ 4] .dynsym DYNSYM 000081f8 0001f8 0000f0 10 A 5 1 4
[ 5] .dynstr STRTAB 000082e8 0002e8 00008d 00 A 0 0 1
[ 6] .gnu.version VERSYM 00008376 000376 00001e 02 A 4 0 2
[ 7] .gnu.version_r VERNEED 00008394 000394 000020 00 A 5 1 4
[ 8] .rel.dyn REL 000083b4 0003b4 000008 08 A 4 0 4
[ 9] .rel.plt REL 000083bc 0003bc 000070 08 A 4 11 4
[10] .init PROGBITS 0000842c 00042c 00000c 00 AX 0 0 4
[11] .plt PROGBITS 00008438 000438 0000bc 04 AX 0 0 4
[12] .text PROGBITS 000084f4 0004f4 000868 00 AX 0 0 4
[13] .fini PROGBITS 00008d5c 000d5c 000008 00 AX 0 0 4
[14] .rodata PROGBITS 00008d64 000d64 000040 00 A 0 0 4
[15] .ARM.exidx ARM_EXIDX 00008da4 000da4 000008 00 AL 12 0 4
[16] .eh_frame PROGBITS 00008dac 000dac 000004 00 A 0 0 4
[17] .init_array INIT_ARRAY 00010f0c 000f0c 000004 00 WA 0 0 4
[18] .fini_array FINI_ARRAY 00010f10 000f10 000004 00 WA 0 0 4
[19] .jcr PROGBITS 00010f14 000f14 000004 00 WA 0 0 4
[20] .dynamic DYNAMIC 00010f18 000f18 0000e8 08 WA 5 0 4
[21] .got PROGBITS 00011000 001000 000048 04 WA 0 0 4
[22] .data PROGBITS 00011048 001048 000008 00 WA 0 0 4
[23] .bss NOBITS 00011050 001050 000008 00 WA 0 0 4
[24] .ARM.attributes ARM_ATTRIBUTES 00000000 001050 000036 00 0 0 1
[25] .comment PROGBITS 00000000 001086 00001b 01 MS 0 0 1
[26] .debug_aranges PROGBITS 00000000 0010a1 000060 00 0 0 1
[27] .debug_pubnames PROGBITS 00000000 001101 0000fb 00 0 0 1
[28] .debug_info PROGBITS 00000000 0011fc 000f5f 00 0 0 1
[29] .debug_abbrev PROGBITS 00000000 00215b 000418 00 0 0 1
[30] .debug_line PROGBITS 00000000 002573 0004ac 00 0 0 1
[31] .debug_frame PROGBITS 00000000 002a20 000130 00 0 0 4
[32] .debug_str PROGBITS 00000000 002b50 000787 01 MS 0 0 1
[33] .debug_loc PROGBITS 00000000 0032d7 00018c 00 0 0 1
[34] .debug_pubtypes PROGBITS 00000000 003463 000270 00 0 0 1
[35] .shstrtab STRTAB 00000000 0036d3 00016b 00 0 0 1
[36] .symtab SYMTAB 00000000 003e30 0008e0 10 37 99 4
[37] .strtab STRTAB 00000000 004710 00039d 00 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings)
I (info), L (link order), G (group), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)
There are no section groups in this file.
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
EXIDX 0x000da4 0x00008da4 0x00008da4 0x00008 0x00008 R 0x4
PHDR 0x000034 0x00008034 0x00008034 0x00140 0x00140 R E 0x4
INTERP 0x000174 0x00008174 0x00008174 0x00013 0x00013 R 0x1
[Requesting program interpreter: /lib/ld-linux.so.3]
LOAD 0x000000 0x00008000 0x00008000 0x00db0 0x00db0 R E 0x8000
LOAD 0x000f0c 0x00010f0c 0x00010f0c 0x00144 0x0014c RW 0x8000
DYNAMIC 0x000f18 0x00010f18 0x00010f18 0x000e8 0x000e8 RW 0x4
NOTE 0x000188 0x00008188 0x00008188 0x00020 0x00020 R 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4
GNU_RELRO 0x000f0c 0x00010f0c 0x00010f0c 0x000f4 0x000f4 R 0x1
PAX_FLAGS 0x000000 0x00000000 0x00000000 0x00000 0x00000 0x4
Section to Segment mapping:
Segment Sections...
00 .ARM.exidx
01
02 .interp
03 .interp .note.ABI-tag .hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .ARM.exidx .eh_frame
04 .init_array .fini_array .jcr .dynamic .got .data .bss
05 .dynamic
06 .note.ABI-tag
07
08 .init_array .fini_array .jcr .dynamic
09
Dynamic section at offset 0xf18 contains 24 entries:
Tag Type Name/Value
0x00000001 (NEEDED) Shared library: [libc.so.6]
0x0000000c (INIT) 0x842c
0x0000000d (FINI) 0x8d5c
0x00000019 (INIT_ARRAY) 0x10f0c
0x0000001b (INIT_ARRAYSZ) 4 (bytes)
0x0000001a (FINI_ARRAY) 0x10f10
0x0000001c (FINI_ARRAYSZ) 4 (bytes)
0x00000004 (HASH) 0x81a8
0x00000005 (STRTAB) 0x82e8
0x00000006 (SYMTAB) 0x81f8
0x0000000a (STRSZ) 141 (bytes)
0x0000000b (SYMENT) 16 (bytes)
0x00000015 (DEBUG) 0x0
0x00000003 (PLTGOT) 0x11000
0x00000002 (PLTRELSZ) 112 (bytes)
0x00000014 (PLTREL) REL
0x00000017 (JMPREL) 0x83bc
0x00000011 (REL) 0x83b4
0x00000012 (RELSZ) 8 (bytes)
0x00000013 (RELENT) 8 (bytes)
0x6ffffffe (VERNEED) 0x8394
0x6fffffff (VERNEEDNUM) 1
0x6ffffff0 (VERSYM) 0x8376
0x00000000 (NULL) 0x0
Relocation section '.rel.dyn' at offset 0x3b4 contains 1 entries:
Offset Info Type Sym.Value Sym. Name
00011044 00000615 R_ARM_GLOB_DAT 00000000 __gmon_start__
Relocation section '.rel.plt' at offset 0x3bc contains 14 entries:
Offset Info Type Sym.Value Sym. Name
0001100c 00000116 R_ARM_JUMP_SLOT 0000844c open
00011010 00000216 R_ARM_JUMP_SLOT 00008458 mmap
00011014 00000316 R_ARM_JUMP_SLOT 00008464 abort
00011018 00000416 R_ARM_JUMP_SLOT 00008470 __libc_start_main
0001101c 00000516 R_ARM_JUMP_SLOT 0000847c epoll_create
00011020 00000616 R_ARM_JUMP_SLOT 00000000 __gmon_start__
00011024 00000716 R_ARM_JUMP_SLOT 00008494 calloc
00011028 00000816 R_ARM_JUMP_SLOT 000084a0 write
0001102c 00000916 R_ARM_JUMP_SLOT 000084ac ioctl
00011030 00000a16 R_ARM_JUMP_SLOT 000084b8 epoll_wait
00011034 00000b16 R_ARM_JUMP_SLOT 000084c4 strcpy
00011038 00000c16 R_ARM_JUMP_SLOT 000084d0 close
0001103c 00000d16 R_ARM_JUMP_SLOT 000084dc puts
00011040 00000e16 R_ARM_JUMP_SLOT 000084e8 epoll_ctl
There are no unwind sections in this file.
Symbol table '.dynsym' contains 15 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000844c 0 FUNC GLOBAL DEFAULT UND open@GLIBC_2.4 (2)
2: 00008458 0 FUNC GLOBAL DEFAULT UND mmap@GLIBC_2.4 (2)
3: 00008464 0 FUNC GLOBAL DEFAULT UND abort@GLIBC_2.4 (2)
4: 00008470 0 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.4 (2)
5: 0000847c 0 FUNC GLOBAL DEFAULT UND epoll_create@GLIBC_2.4 (2)
6: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__
7: 00008494 0 FUNC GLOBAL DEFAULT UND calloc@GLIBC_2.4 (2)
8: 000084a0 0 FUNC GLOBAL DEFAULT UND write@GLIBC_2.4 (2)
9: 000084ac 0 FUNC GLOBAL DEFAULT UND ioctl@GLIBC_2.4 (2)
10: 000084b8 0 FUNC GLOBAL DEFAULT UND epoll_wait@GLIBC_2.4 (2)
11: 000084c4 0 FUNC GLOBAL DEFAULT UND strcpy@GLIBC_2.4 (2)
12: 000084d0 0 FUNC GLOBAL DEFAULT UND close@GLIBC_2.4 (2)
13: 000084dc 0 FUNC GLOBAL DEFAULT UND puts@GLIBC_2.4 (2)
14: 000084e8 0 FUNC GLOBAL DEFAULT UND epoll_ctl@GLIBC_2.4 (2)
Symbol table '.symtab' contains 142 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 00008174 0 SECTION LOCAL DEFAULT 1
2: 00008188 0 SECTION LOCAL DEFAULT 2
3: 000081a8 0 SECTION LOCAL DEFAULT 3
4: 000081f8 0 SECTION LOCAL DEFAULT 4
5: 000082e8 0 SECTION LOCAL DEFAULT 5
6: 00008376 0 SECTION LOCAL DEFAULT 6
7: 00008394 0 SECTION LOCAL DEFAULT 7
8: 000083b4 0 SECTION LOCAL DEFAULT 8
9: 000083bc 0 SECTION LOCAL DEFAULT 9
10: 0000842c 0 SECTION LOCAL DEFAULT 10
11: 00008438 0 SECTION LOCAL DEFAULT 11
12: 000084f4 0 SECTION LOCAL DEFAULT 12
13: 00008d5c 0 SECTION LOCAL DEFAULT 13
14: 00008d64 0 SECTION LOCAL DEFAULT 14
15: 00008da4 0 SECTION LOCAL DEFAULT 15
16: 00008dac 0 SECTION LOCAL DEFAULT 16
17: 00010f0c 0 SECTION LOCAL DEFAULT 17
18: 00010f10 0 SECTION LOCAL DEFAULT 18
19: 00010f14 0 SECTION LOCAL DEFAULT 19
20: 00010f18 0 SECTION LOCAL DEFAULT 20
21: 00011000 0 SECTION LOCAL DEFAULT 21
22: 00011048 0 SECTION LOCAL DEFAULT 22
23: 00011050 0 SECTION LOCAL DEFAULT 23
24: 00000000 0 SECTION LOCAL DEFAULT 24
25: 00000000 0 SECTION LOCAL DEFAULT 25
26: 00000000 0 SECTION LOCAL DEFAULT 26
27: 00000000 0 SECTION LOCAL DEFAULT 27
28: 00000000 0 SECTION LOCAL DEFAULT 28
29: 00000000 0 SECTION LOCAL DEFAULT 29
30: 00000000 0 SECTION LOCAL DEFAULT 30
31: 00000000 0 SECTION LOCAL DEFAULT 31
32: 00000000 0 SECTION LOCAL DEFAULT 32
33: 00000000 0 SECTION LOCAL DEFAULT 33
34: 00000000 0 SECTION LOCAL DEFAULT 34
35: 00000000 0 FILE LOCAL DEFAULT ABS initfini.c
36: 00008530 0 NOTYPE LOCAL DEFAULT 12 $a
37: 00008530 0 FUNC LOCAL DEFAULT 12 call_gmon_start
38: 0000854c 0 NOTYPE LOCAL DEFAULT 12 $d
39: 0000842c 0 NOTYPE LOCAL DEFAULT 10 $a
40: 00008d5c 0 NOTYPE LOCAL DEFAULT 13 $a
41: 00008188 0 NOTYPE LOCAL DEFAULT 2 $d
42: 000084f4 0 NOTYPE LOCAL DEFAULT 12 $a
43: 00008da4 0 NOTYPE LOCAL DEFAULT 15 $d
44: 00008524 0 NOTYPE LOCAL DEFAULT 12 $d
45: 00000000 0 FILE LOCAL DEFAULT ABS init.c
46: 00008d64 0 NOTYPE LOCAL DEFAULT 14 $d
47: 00000000 0 FILE LOCAL DEFAULT ABS initfini.c
48: 00008434 0 NOTYPE LOCAL DEFAULT 10 $a
49: 00008d60 0 NOTYPE LOCAL DEFAULT 13 $a
50: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c
51: 00010f14 0 OBJECT LOCAL DEFAULT 19 __JCR_LIST__
52: 0001104c 0 NOTYPE LOCAL DEFAULT 22 $d
53: 00008554 0 NOTYPE LOCAL DEFAULT 12 $a
54: 00008554 0 FUNC LOCAL DEFAULT 12 __do_global_dtors_aux
55: 0000856c 0 NOTYPE LOCAL DEFAULT 12 $d
56: 00011050 1 OBJECT LOCAL DEFAULT 23 completed.5796
57: 00010f10 0 NOTYPE LOCAL DEFAULT 18 $d
58: 00010f10 0 OBJECT LOCAL DEFAULT 18 __do_global_dtors_aux_fin
59: 00008570 0 NOTYPE LOCAL DEFAULT 12 $a
60: 00008570 0 FUNC LOCAL DEFAULT 12 frame_dummy
61: 00008598 0 NOTYPE LOCAL DEFAULT 12 $d
62: 00010f0c 0 NOTYPE LOCAL DEFAULT 17 $d
63: 00010f0c 0 OBJECT LOCAL DEFAULT 17 __frame_dummy_init_array_
64: 00011050 0 NOTYPE LOCAL DEFAULT 23 $d
65: 00000000 0 FILE LOCAL DEFAULT ABS net.c
66: 000085a0 0 NOTYPE LOCAL DEFAULT 12 $a
67: 00000010 0 NOTYPE LOCAL DEFAULT 31 $d
68: 00000000 0 FILE LOCAL DEFAULT ABS main.c
69: 000085bc 0 NOTYPE LOCAL DEFAULT 12 $a
70: 000088a4 0 NOTYPE LOCAL DEFAULT 12 $d
71: 00000038 0 NOTYPE LOCAL DEFAULT 31 $d
72: 00000000 0 FILE LOCAL DEFAULT ABS cam.c
73: 00008d68 0 NOTYPE LOCAL DEFAULT 14 $d
74: 000088ac 0 NOTYPE LOCAL DEFAULT 12 $a
75: 00008974 0 NOTYPE LOCAL DEFAULT 12 $d
76: 00008984 0 NOTYPE LOCAL DEFAULT 12 $a
77: 00008c34 0 NOTYPE LOCAL DEFAULT 12 $d
78: 00008c60 0 NOTYPE LOCAL DEFAULT 12 $a
79: 00008c9c 0 NOTYPE LOCAL DEFAULT 12 $d
80: 00008ca0 0 NOTYPE LOCAL DEFAULT 12 $a
81: 000000bc 0 NOTYPE LOCAL DEFAULT 31 $d
82: 00000000 0 FILE LOCAL DEFAULT ABS cfg.c
83: 00000000 0 FILE LOCAL DEFAULT ABS elf-init.c
84: 00008cf0 0 NOTYPE LOCAL DEFAULT 12 $a
85: 00008d4c 0 NOTYPE LOCAL DEFAULT 12 $d
86: 00008d58 0 NOTYPE LOCAL DEFAULT 12 $a
87: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c
88: 00008dac 0 NOTYPE LOCAL DEFAULT 16 $d
89: 00008dac 0 OBJECT LOCAL DEFAULT 16 __FRAME_END__
90: 00010f14 0 NOTYPE LOCAL DEFAULT 19 $d
91: 00010f14 0 OBJECT LOCAL DEFAULT 19 __JCR_END__
92: 00011000 0 OBJECT LOCAL HIDDEN 21 _GLOBAL_OFFSET_TABLE_
93: 00010f10 0 NOTYPE LOCAL HIDDEN 17 __init_array_end
94: 00010f0c 0 NOTYPE LOCAL HIDDEN 17 __init_array_start
95: 00010f18 0 OBJECT LOCAL HIDDEN 20 _DYNAMIC
96: 00008438 0 NOTYPE LOCAL DEFAULT 11 $a
97: 00008448 0 NOTYPE LOCAL DEFAULT 11 $d
98: 0000844c 0 NOTYPE LOCAL DEFAULT 11 $a
99: 00011048 0 NOTYPE WEAK DEFAULT 22 data_start
100: 0000844c 0 FUNC GLOBAL DEFAULT UND open@@GLIBC_2.4
101: 00008458 0 FUNC GLOBAL DEFAULT UND mmap@@GLIBC_2.4
102: 00008464 0 FUNC GLOBAL DEFAULT UND abort@@GLIBC_2.4
103: 00008d58 4 FUNC GLOBAL DEFAULT 12 __libc_csu_fini
104: 000084f4 0 FUNC GLOBAL DEFAULT 12 _start
105: 00008470 0 FUNC GLOBAL DEFAULT UND __libc_start_main@@GLIBC_
106: 0000847c 0 FUNC GLOBAL DEFAULT UND epoll_create@@GLIBC_2.4
107: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__
108: 00000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses
109: 000085a0 28 FUNC GLOBAL DEFAULT 12 net_sys_init
110: 00008d5c 0 FUNC GLOBAL DEFAULT 13 _fini
111: 00011054 4 OBJECT GLOBAL DEFAULT 23 srv_main
112: 00008494 0 FUNC GLOBAL DEFAULT UND calloc@@GLIBC_2.4
113: 00008d64 4 OBJECT GLOBAL DEFAULT 14 _IO_stdin_used
114: 000084a0 0 FUNC GLOBAL DEFAULT UND write@@GLIBC_2.4
115: 00008ca0 80 FUNC GLOBAL DEFAULT 12 cam_sys_init
116: 0000862c 124 FUNC GLOBAL DEFAULT 12 epoll_add_event
117: 00011048 0 NOTYPE GLOBAL DEFAULT 22 __data_start
118: 00011050 0 NOTYPE GLOBAL DEFAULT ABS __bss_start__
119: 000084ac 0 FUNC GLOBAL DEFAULT UND ioctl@@GLIBC_2.4
120: 000084b8 0 FUNC GLOBAL DEFAULT UND epoll_wait@@GLIBC_2.4
121: 00008dac 0 NOTYPE GLOBAL DEFAULT ABS __exidx_end
122: 0001104c 0 OBJECT GLOBAL HIDDEN 22 __dso_handle
123: 000084c4 0 FUNC GLOBAL DEFAULT UND strcpy@@GLIBC_2.4
124: 00011058 0 NOTYPE GLOBAL DEFAULT ABS __end__
125: 00008cf0 104 FUNC GLOBAL DEFAULT 12 __libc_csu_init
126: 00011058 0 NOTYPE GLOBAL DEFAULT ABS __bss_end__
127: 00008c60 64 FUNC GLOBAL DEFAULT 12 v4l2_start_capture
128: 000084d0 0 FUNC GLOBAL DEFAULT UND close@@GLIBC_2.4
129: 00011050 0 NOTYPE GLOBAL DEFAULT ABS __bss_start
130: 000086a8 76 FUNC GLOBAL DEFAULT 12 epoll_del_event
131: 00011058 0 NOTYPE GLOBAL DEFAULT ABS _bss_end__
132: 000088ac 216 FUNC GLOBAL DEFAULT 12 cam_handler
133: 000084dc 0 FUNC GLOBAL DEFAULT UND puts@@GLIBC_2.4
134: 00011058 0 NOTYPE GLOBAL DEFAULT ABS _end
135: 000085bc 112 FUNC GLOBAL DEFAULT 12 epoll_event_creat
136: 00008984 732 FUNC GLOBAL DEFAULT 12 v4l2_init
137: 00011050 0 NOTYPE GLOBAL DEFAULT ABS _edata
138: 000084e8 0 FUNC GLOBAL DEFAULT UND epoll_ctl@@GLIBC_2.4
139: 00008da4 0 NOTYPE GLOBAL DEFAULT ABS __exidx_start
140: 000086f4 440 FUNC GLOBAL DEFAULT 12 main
141: 0000842c 0 FUNC GLOBAL DEFAULT 10 _init
Histogram for bucket list length (total of 3 buckets):
Length Number % of total Coverage
0 0 ( 0.0%)
1 0 ( 0.0%) 0.0%
2 0 ( 0.0%) 0.0%
3 0 ( 0.0%) 0.0%
4 1 ( 33.3%) 28.6%
5 2 ( 66.7%) 100.0%
Version symbols section '.gnu.version' contains 15 entries:
Addr: 0000000000008376 Offset: 0x000376 Link: 4 (.dynsym)
000: 0 (*local*) 2 (GLIBC_2.4) 2 (GLIBC_2.4) 2 (GLIBC_2.4)
004: 2 (GLIBC_2.4) 2 (GLIBC_2.4) 0 (*local*) 2 (GLIBC_2.4)
008: 2 (GLIBC_2.4) 2 (GLIBC_2.4) 2 (GLIBC_2.4) 2 (GLIBC_2.4)
00c: 2 (GLIBC_2.4) 2 (GLIBC_2.4) 2 (GLIBC_2.4)
Version needs section '.gnu.version_r' contains 1 entries:
Addr: 0x0000000000008394 Offset: 0x000394 Link: 5 (.dynstr)
000000: Version: 1 File: libc.so.6 Cnt: 1
0x0010: Name: GLIBC_2.4 Flags: none Version: 2
Notes at offset 0x00000188 with length 0x00000020:
Owner Data size Description
GNU 0x00000010 NT_GNU_ABI_TAG (ABI version tag)
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "ARM1176JZF-S"
Tag_CPU_arch: v6K
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-1
Tag_VFP_arch: VFPv2
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align8_needed: Yes
Tag_ABI_align8_preserved: Yes, except leaf SP
Tag_ABI_enum_size: int
Tag_ABI_HardFP_use: SP and DP
在PC上通过指令:locate libc.so.6 找到此库文件的位置,拷到开发板文件系统/lib/下(把缺少的库文件都拷一下)
问题得到解决!