This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Loading an elf file


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]