2023年12月24日发(作者:)

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: DYN (Shared object file) Machine: ARM Version: 0x1 Entry point address: 0x0 Start of program headers: 52 (bytes into file) Start of section headers: 12664 (bytes into file) Flags: 0x5000200, Version5 EABI, soft-float ABI Size of this header: 52 (bytes) Size of program headers: 32 (bytes) Number of program headers: 9 Size of section headers: 40 (bytes) Number of section headers: 26 Section header string table index: 25

1.4 read Program Header arm-linux-androideabi-readelf -l ~/Public/

Elf file type is DYN (Shared object file)Entry point 0x0There are 9 program headers, starting at offset 52Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR 0x000034 0x00000034 0x00000034 0x00120 0x00120 R 0x4 INTERP 0x000154 0x00000154 0x00000154 0x00013 0x00013 R 0x1 [Requesting program interpreter: /system/bin/linker] LOAD 0x000000 0x00000000 0x00000000 0x0246a 0x0246a R E 0x1000 LOAD 0x002e80 0x00003e80 0x00003e80 0x00188 0x00188 RW 0x1000 DYNAMIC 0x002e8c 0x00003e8c 0x00003e8c 0x00128 0x00128 RW 0x4 NOTE 0x000168 0x00000168 0x00000168 0x00024 0x00024 R 0x4 GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0 EXIDX 0x002304 0x00002304 0x00002304 0x00100 0x00100 R 0x4 GNU_RELRO 0x002e80 0x00003e80 0x00003e80 0x00180 0x00180 RW 0x4 Section to Segment mapping: 00

01 .interp

02 .interp .-id .dynsym .dynstr .hash .n .n_d .n_r . . .plt .text . . .rodata

03 .fini_array .init_array .dynamic .got .data

04 .dynamic

05 .-id

06

07 .

08 .fini_array .init_array .dynamic .got 1.5 read Section Header

Dynamic section at offset 0x2e8c contains 32 entries: Tag Type Name/Value 0x00000003 (PLTGOT) 0x3fd4 0x00000002 (PLTRELSZ) 64 (bytes) 0x00000017 (JMPREL) 0xc74 0x00000014 (PLTREL) REL 0x00000011 (REL) 0xc24 0x00000012 (RELSZ) 80 (bytes) 0x00000013 (RELENT) 8 (bytes) 0x6ffffffa (RELCOUNT) 7 0x00000006 (SYMTAB) 0x18c 0x0000000b (SYMENT) 16 (bytes) 0x00000005 (STRTAB) 0x51c 0x0000000a (STRSZ) 1239 (bytes) 0x00000004 (HASH) 0x9f4 0x00000001 (NEEDED) Shared library: [] 0x00000001 (NEEDED) Shared library: [] 0x00000001 (NEEDED) Shared library: [libstdc++.so] 0x00000001 (NEEDED) Shared library: [] 0x00000001 (NEEDED) Shared library: [] 0x0000000e (SONAME) Library soname: [] 0x0000001a (FINI_ARRAY) 0x3e80 0x0000001c (FINI_ARRAYSZ) 8 (bytes) 0x00000019 (INIT_ARRAY) 0x3e88 0x0000001b (INIT_ARRAYSZ) 4 (bytes) 0x00000010 (SYMBOLIC) 0x0 0x0000001e (FLAGS) SYMBOLIC BIND_NOW 0x6ffffffb (FLAGS_1) Flags: NOW 0x6ffffff0 (VERSYM) 0xb74 0x6ffffffc (VERDEF) 0xbe8 0x6ffffffd (VERDEFNUM) 1 0x6ffffffe (VERNEED) 0xc04 0x6fffffff (VERNEEDNUM) 1 0x00000000 (NULL) 0x0 关于Dynamic Section字段的含义,详细请参考 。 1.8 read Dynsym Section Actual Data arm-linux-androideabi-readelf -s ~/Public/

Symbol table '.dynsym' contains 57 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND

1: 00000000 0 FUNC GLOBAL DEFAULT UND __cxa_finalize@LIBC (2) 2: 00000000 0 FUNC GLOBAL DEFAULT UND __cxa_atexit@LIBC (2) 3: 00000d65 52 FUNC GLOBAL DEFAULT 12 Java_com_example_ndkplt_P 4: 00000000 0 FUNC GLOBAL DEFAULT UND puts@LIBC (2) 5: 00004004 4 OBJECT GLOBAL DEFAULT 20 global_fun 6: 00001904 8 FUNC WEAK DEFAULT 12 __aeabi_unwind_cpp_pr1 7: 000018fc 8 FUNC GLOBAL DEFAULT 12 __aeabi_unwind_cpp_pr0 8: 0000190c 8 FUNC WEAK DEFAULT 12 __aeabi_unwind_cpp_pr2 9: 00000000 0 FUNC WEAK DEFAULT UND __gnu_Unwind_Find_exidx 10: 00001ca4 0 FUNC GLOBAL DEFAULT 12 __gnu_Unwind_Restore_VFP_ 11: 00001c94 0 FUNC GLOBAL DEFAULT 12 __gnu_Unwind_Restore_VFP 12: 00001cb4 0 FUNC GLOBAL DEFAULT 12 __gnu_Unwind_Restore_VFP_ 13: 00001cc4 0 FUNC GLOBAL DEFAULT 12 __gnu_Unwind_Restore_WMMX 14: 00001d4c 0 FUNC GLOBAL DEFAULT 12 __gnu_Unwind_Restore_WMMX 15: 00000000 0 FUNC GLOBAL DEFAULT UND abort@LIBC (2) 16: 00001c80 20 FUNC GLOBAL DEFAULT 12 restore_core_regs 17: 00000000 0 FUNC GLOBAL DEFAULT UND memcpy@LIBC (2) 18: 000011c0 8 FUNC GLOBAL DEFAULT 12 _Unwind_GetCFA 19: 000011c8 164 FUNC GLOBAL DEFAULT 12 __gnu_Unwind_RaiseExcepti 20: 0000126c 28 FUNC GLOBAL DEFAULT 12 __gnu_Unwind_ForcedUnwind 21: 00001288 116 FUNC GLOBAL DEFAULT 12 __gnu_Unwind_Resume 22: 000012fc 32 FUNC GLOBAL DEFAULT 12 __gnu_Unwind_Resume_or_Re 23: 0000131c 4 FUNC GLOBAL DEFAULT 12 _Unwind_Complete 24: 00001320 24 FUNC GLOBAL DEFAULT 12 _Unwind_DeleteException 25: 00001338 92 FUNC GLOBAL DEFAULT 12 _Unwind_VRS_Get 26: 000013bc 92 FUNC GLOBAL DEFAULT 12 _Unwind_VRS_Set 27: 00001444 200 FUNC GLOBAL DEFAULT 12 __gnu_Unwind_Backtrace 28: 00000000 0 NOTYPE WEAK DEFAULT UND __cxa_begin_cleanup 29: 00000000 0 NOTYPE WEAK DEFAULT UND __cxa_type_match 30: 00001eb4 904 FUNC GLOBAL DEFAULT 12 __gnu_unwind_execute 31: 00000000 0 NOTYPE WEAK DEFAULT UND __cxa_call_unexpected 32: 00001914 876 FUNC GLOBAL DEFAULT 12 _Unwind_VRS_Pop 33: 00001cac 0 FUNC GLOBAL DEFAULT 12 __gnu_Unwind_Save_VFP_D 34: 00001c9c 0 FUNC GLOBAL DEFAULT 12 __gnu_Unwind_Save_VFP 35: 00001cbc 0 FUNC GLOBAL DEFAULT 12 __gnu_Unwind_Save_VFP_D_1 36: 00001d08 0 FUNC GLOBAL DEFAULT 12 __gnu_Unwind_Save_WMMXD 37: 00001d60 0 FUNC GLOBAL DEFAULT 12 __gnu_Unwind_Save_WMMXC 38: 00001c80 20 FUNC GLOBAL DEFAULT 12 __restore_core_regs 39: 00001d74 36 FUNC GLOBAL DEFAULT 12 ___Unwind_RaiseException 40: 00001d74 36 FUNC GLOBAL DEFAULT 12 _Unwind_RaiseException 41: 00001d98 36 FUNC GLOBAL DEFAULT 12 ___Unwind_Resume 42: 00001d98 36 FUNC GLOBAL DEFAULT 12 _Unwind_Resume 43: 00001dbc 36 FUNC GLOBAL DEFAULT 12 ___Unwind_Resume_or_Rethr 44: 00001dbc 36 FUNC GLOBAL DEFAULT 12 _Unwind_Resume_or_Rethrow 45: 00001de0 36 FUNC GLOBAL DEFAULT 12 ___Unwind_ForcedUnwind 46: 00001de0 36 FUNC GLOBAL DEFAULT 12 _Unwind_ForcedUnwind 47: 00001e04 36 FUNC GLOBAL DEFAULT 12 ___Unwind_Backtrace 48: 00001e04 36 FUNC GLOBAL DEFAULT 12 _Unwind_Backtrace 49: 0000223c 64 FUNC GLOBAL DEFAULT 12 __gnu_unwind_frame 50: 0000227c 16 FUNC GLOBAL DEFAULT 12 _Unwind_GetRegionStart 51: 0000228c 28 FUNC GLOBAL DEFAULT 12 _Unwind_GetLanguageSpecif 52: 000022a8 8 FUNC GLOBAL DEFAULT 12 _Unwind_GetDataRelBase 53: 000022b0 8 FUNC GLOBAL DEFAULT 12 _Unwind_GetTextRelBase 54: 00004008 0 NOTYPE GLOBAL DEFAULT ABS _edata 55: 00004008 0 NOTYPE GLOBAL DEFAULT ABS __bss_start 56: 00004008 0 NOTYPE GLOBAL DEFAULT ABS _end

关于DynSym Section字段的含义,详细请参考