我正在使用 readelf 命令分析 ELF 文件。我查看了程序头和节头,但发现并非所有节都映射到一个段。我提供了部分 readelf 输出:
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] ddr_data_nc_wt NOBITS 70001800 0000b4 000000 00 W 0 0 1
[ 2] ddr_data_c_wb NOBITS 70001800 0000b4 000000 00 W 0 0 1
[ 3] ddr_text_c NOBITS 70001800 0000b4 000000 00 X 0 0 1
[ 4] m2_textboot_c LOPROC+0 b0000000 0000c0 0023cc 00 AX 0 2952790016 2
[ 5] m2_text_c LOPROC+0 38000000 002490 004d22 00 AX 0 2952799232 16
[ 6] m2_data_c_wb LOPROC+5 70000000 0071c0 0006a8 00 WA 0 2952819200 2
[ 7] data_boot_c LOPROC+5 20000000 007870 000100 00 WA 0 2953019392 4
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
LOAD 0x0000c0 0xb0000000 0xb0000000 0x023cc 0x023cc R E 0x2
LOAD 0x002490 0xb0002400 0xb0002400 0x04d22 0x04d22 R E 0x10
LOAD 0x0071c0 0xb0007200 0xb0007200 0x006a8 0x017a8 RW 0x2
LOAD 0x007870 0xb0038000 0xb0038000 0x00100 0x08000 RW 0x4
Section to Segment mapping:
Segment Sections...
00 m2_textboot_c
01
02
03
There is no dynamic section in this file.
There are no relocations in this file.
There are no unwind sections in this file.
我发现只有 m2_textboot_c 部分被映射到 Segment 00,但没有提及其他部分的映射位置。你能告诉我什么可能是错的,应该怎么做吗?
另外,我想知道是否有任何机制可以使用节头而不是程序头将 ELF 二进制文件加载到处理器上。我遇到的每个在线帮助都使用程序头文件加载二进制文件。