Loading an elf file
Bahadir Balban
bahadir@l4dev.org
Fri Apr 9 09:50:00 GMT 2010
Hi,
I am trying to load an elf file. Often read-only, writeable and exec
sections are packed into one loadable segment as below:
> Program Headers:
> Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
> LOAD 0x008000 0xf0008000 0x00008000 0x29000 0x2f21c RWE 0x8000
> LOAD 0x038000 0xf0038000 0x00038000 0x044e8 0x044e8 RW 0x8000
>
> Section to Segment mapping:
> Segment Sections...
> 00 .text .rodata .data .bss
> 01 .init
This forces me to inspect sections rather than program segments to
distinguish RX, RO, RW parts of the executable.
Firstly is the above elf file correctly assembled? Secondly I thought
the standard practice to load an elf file is to use program headers
only, but I am obliged to inspect sections. Can you comment?
Thanks,
--
Bahadir
More information about the Binutils
mailing list