The ELF Object File Format: Introduction | Search for a title, author or keyword | ||||||||
The ELF Object File Format: Introduction Apr 01, 1995 By Eric Youngdale. The Executable and Linking Format ( ELF ) has been a popular topic lately. People wonder why the kernel configuations script asks whether or not to configure loading ELF executables. As ELF will eventually be the common object file format for Linux binaries, it is appropriate to document it a bit. This month, Eric introduces us to ELF, and next month he will give us a guided tour of real ELF files. I will also guide you on a tour of the internals of the ELF file format and show you how it works. I realize that Linux users range from people brand new to Unix to people who have used Unix systems for years—for this reason I will start with a fairly basic explanation which may be of little use to the more experienced users, because I would like this article to be useful in some way to as many people as possible. One universal concept among all different ELF file types ( and also a.out and many other executable file formats ) is the notion of a section. This concept is important enough to spend some time explaining. Simply put, a section is a collection of information of a similar type. Each section represents a portion of the file. For example, executable code is always placed in a section known as ".text"; all data variables initialized by the user are placed in a section known as ".data"; and uninitialized data is placed in a section known as ".bss". Given that we want all executable portions of an executable in read-only memory and all modifiable locations of memory ( such as variables ) in writable memory, it turns out to be most efficient to group all of the executable portions of an executable into one section of memory ( the ".text" section ), and all modifiable data areas together into another area of memory ( henceforth known as the ".data" section ). A further distinction is made between data variables the user has initialized and data variables the user has not initialized. If the user has not specified the initial value of a variable, there is no sense wasting space in the executable file to store the value. Thus, initialized variables are grouped into the ".data" section, and uninitialized variables are grouped into the ".bss" section, which is special because it doesn't take up space in the file — it only tells how much space is needed for uninitialized variables.
|
|||||||||
The ELF Object File Format: Introduction | Disclaimer: this link points to content provided by other sites. |