I am analyzing an ELF file using readelf command. I looked at the program headers and section headers, but found that not all of the sections were getting mapped to a segment. I am providing some part of the readelf output:
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.
I find that only the section m2_textboot_c is getting mapped Segment 00, but no mention of where the other sections are mapped. Can you please give me any idea about what might be wrong and what should be done?
Also, I was wondering if there is any mechanism for loading the ELF binary onto the processor using the section headers instead of program headers. Every online help I came across loads the binary using program headers.