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
Object file
(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!
=== Segmentation === Most object file formats are structured as separate sections of data, each section containing a certain type of data. These sections are known as "segments" due to the term "[[memory segment]]", which was previously a common form of [[memory management]]. When a program is loaded into memory by a [[loader (computing)|loader]], the loader allocates various regions of memory to the program. Some of these regions correspond to sections of the object file, and thus are usually known by the same names. Others, such as the stack, only exist at run time. In some cases, [[relocation (computing)|relocation]] is done by the loader (or linker) to specify the actual memory addresses. However, for many programs or architectures, relocation is not necessary, due to being handled by the [[memory management unit]] or by [[position-independent code]]. On some systems the segments of the object file can then be copied (paged) into memory and executed, without needing further processing. On these systems, this may be done ''lazily'', that is, only when the segments are referenced during execution, for example via a [[memory-mapped file]] backed by the object file. Types of data supported by typical object file formats:<ref name="Mauerer_2010"/> * Header (descriptive and control information) * [[Code segment]] ("text segment", executable code) * [[Data segment]] (initialized [[static variable]]s) * Read-only data segment (''[[rodata]],'' initialized static [[constant (computer programming)|constants]]) * [[BSS segment]] (uninitialized static data, both variables and constants) * External definitions and references for linking * [[Relocation (computer science)|Relocation]] information * [[Dynamic linking]] information * [[Debugging]] information Segments in different object files may be combined by the linker according to rules specified when the segments are defined. Conventions exist for segments shared between object files; for instance, in [[DOS]] there are [[x86 memory models|different memory models]] that specify the names of special segments and whether or not they may be combined.<ref name="Irvine_1993"/> The [[debugging data format]] of debugging information may either be an integral part of the object file format, as in [[COFF]], or a semi-independent format which may be used with several object formats, such as [[stabs]] or [[DWARF]].
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)