Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Executable and Linkable Format
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Program header === The program header table tells the system how to create a process image. It is found at file offset {{mono|e_phoff}}, and consists of {{mono|e_phnum}} entries, each with size {{mono|e_phentsize}}. The layout is slightly different in [[32-bit]] ELF vs [[64-bit]] ELF, because the {{mono|p_flags}} are in a different structure location for alignment reasons. Each entry is structured as: {| class="wikitable" |+ Program header<ref>{{cite web|url=http://www.sco.com/developers/gabi/2000-07-17/ch5.pheader.html |title=Program Header |publisher=Sco.com |date=July 2000 |access-date=2017-04-05}}</ref> |- ! colspan="2" | Offset!! colspan="2" | Size (bytes) !! rowspan="2" | Field !! rowspan="2" | Purpose |- ! 32-bit !! 64-bit !! 32-bit !! 64-bit |- | colspan="2" | {{tt|0x00}} || colspan="2" | 4 ||{{mono|p_type}}||Identifies the type of the segment. {| class="wikitable" |- !Value!!Name!!Meaning |- | {{tt|0x00000000}} ||{{mono|PT_NULL}} | Program header table entry unused. |- | {{tt|0x00000001}} ||{{mono|PT_LOAD}} | Loadable segment. |- | {{tt|0x00000002}} ||{{mono|PT_DYNAMIC}} | Dynamic linking information. |- | {{tt|0x00000003}} ||{{mono|PT_INTERP}} | Interpreter information. |- | {{tt|0x00000004}} ||{{mono|PT_NOTE}} | Auxiliary information. |- | {{tt|0x00000005}} ||{{mono|PT_SHLIB}} | Reserved. |- | {{tt|0x00000006}} ||{{mono|PT_PHDR}} | Segment containing program header table itself. |- | {{tt|0x00000007}} ||{{mono|PT_TLS}} | Thread-Local Storage template. |- | {{tt|0x60000000}} ||{{mono|PT_LOOS}} | rowspan="2" | Reserved inclusive range. Operating system specific. |- | {{tt|0x6FFFFFFF}} ||{{mono|PT_HIOS}} |- | {{tt|0x70000000}} ||{{mono|PT_LOPROC}} | rowspan="2" | Reserved inclusive range. Processor specific. |- | {{tt|0x7FFFFFFF}} ||{{mono|PT_HIPROC}} |} |- | || {{tt|0x04}} || || 4 ||{{mono|p_flags}}||Segment-dependent flags (position for 64-bit structure). {| class="wikitable" !Value !Name !Meaning |- | {{tt|0x1}} |{{mono|PF_X}} |Executable segment. |- | {{tt|0x2}} |{{mono|PF_W}} |Writeable segment. |- | {{tt|0x4}} |{{mono|PF_R}} |Readable segment. |} |- | {{tt|0x04}} || {{tt|0x08}} || 4 || 8||{{mono|p_offset}}||Offset of the segment in the file image. |- | {{tt|0x08}} || {{tt|0x10}} || 4 || 8 ||{{mono|p_vaddr}}||Virtual address of the segment in memory. |- | {{tt|0x0C}} || {{tt|0x18}} || 4 || 8 ||{{mono|p_paddr}}||On systems where physical address is relevant, reserved for segment's physical address. |- | {{tt|0x10}} || {{tt|0x20}} || 4 || 8 ||{{mono|p_filesz}}||Size in bytes of the segment in the file image. May be 0. |- | {{tt|0x14}} || {{tt|0x28}} || 4 || 8 ||{{mono|p_memsz}}||Size in bytes of the segment in memory. May be 0. |- | {{tt|0x18}} || || 4 || ||{{mono|p_flags}}||Segment-dependent flags (position for 32-bit structure). See above <code>p_flags</code> field for flag definitions. |- | {{tt|0x1C}} || {{tt|0x30}} || 4 || 8 ||{{mono|p_align}}||<code>0</code> and <code>1</code> specify no alignment. Otherwise should be a positive, integral power of 2, with {{mono|p_vaddr}} equating {{mono|p_offset}} modulus {{mono|p_align}}. |- | {{tt|0x20}} | {{tt|0x38}} | colspan="3" | |End of Program Header (size). |}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)