Changeset View
Standalone View
share/man/man5/elf.5
Show All 18 Lines | |||||||||||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||||||||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||||||||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||||||||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||||||||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||||||||||
.\" | .\" | ||||||||||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||||||||||
.\" | .\" | ||||||||||||
.Dd March 11, 2020 | .Dd November 27, 2021 | ||||||||||||
.Dt ELF 5 | .Dt ELF 5 | ||||||||||||
.Os | .Os | ||||||||||||
.Sh NAME | .Sh NAME | ||||||||||||
.Nm elf | .Nm elf | ||||||||||||
.Nd format of ELF executable binary files | .Nd format of ELF executable binary files | ||||||||||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||||||||||
.In elf.h | .In elf.h | ||||||||||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||||||||||
▲ Show 20 Lines • Show All 754 Lines • ▼ Show 20 Lines | |||||||||||||
sections do not reside in the memory image of an object file. | sections do not reside in the memory image of an object file. | ||||||||||||
This | This | ||||||||||||
attribute is off for those sections. | attribute is off for those sections. | ||||||||||||
.It Dv SHF_EXECINSTR | .It Dv SHF_EXECINSTR | ||||||||||||
The section contains executable machine instructions. | The section contains executable machine instructions. | ||||||||||||
.It Dv SHF_MASKPROC | .It Dv SHF_MASKPROC | ||||||||||||
All bits included in this mask are reserved for processor-specific | All bits included in this mask are reserved for processor-specific | ||||||||||||
semantics. | semantics. | ||||||||||||
.It Dv SHF_COMPRESSED | |||||||||||||
The section data is compressed. | |||||||||||||
.El | .El | ||||||||||||
.Pp | .Pp | ||||||||||||
.It Dv sh_addr | .It Dv sh_addr | ||||||||||||
If the section will appear in the memory image of a process, this member | If the section will appear in the memory image of a process, this member | ||||||||||||
holds the address at which the section's first byte should reside. | holds the address at which the section's first byte should reside. | ||||||||||||
Otherwise, the member contains zero. | Otherwise, the member contains zero. | ||||||||||||
.It Dv sh_offset | .It Dv sh_offset | ||||||||||||
This member's value holds the byte offset from the beginning of the file | This member's value holds the byte offset from the beginning of the file | ||||||||||||
▲ Show 20 Lines • Show All 258 Lines • ▼ Show 20 Lines | |||||||||||||
.Sy SHF_EXECINSTR . | .Sy SHF_EXECINSTR . | ||||||||||||
.It .jcr | .It .jcr | ||||||||||||
This section holds information about Java classes that must | This section holds information about Java classes that must | ||||||||||||
be registered. | be registered. | ||||||||||||
.It .eh_frame | .It .eh_frame | ||||||||||||
This section holds information used for C++ exception-handling. | This section holds information used for C++ exception-handling. | ||||||||||||
.El | .El | ||||||||||||
.Pp | .Pp | ||||||||||||
A section with the | |||||||||||||
.Dv SHF_COMPRESSED | |||||||||||||
flag set contains a compressed copy of the section data. | |||||||||||||
Compressed section data begins with an | |||||||||||||
emaste: an Elf64_...? | |||||||||||||
Not Done Inline Actions
Nope, it's "a structure" even if it's a specific type of structure. debdrup: > an Elf64_...?
Nope, it's "a structure" even if it's a specific type of structure. | |||||||||||||
Not Done Inline Actions
I think he just meant that an a in front of Elf should really be an an. danfe: > > an Elf64_...?
>
> Nope, it's "a structure" even if it's a specific type of structure.
I… | |||||||||||||
Not Done Inline Actions
No, it's still 'a structure', not 'an structure'. debdrup: > > > an Elf64_...?
> >
> > Nope, it's "a structure" even if it's a specific type of structure. | |||||||||||||
Not Done Inline Actions
This is really news to me, a Elf structure doesn't sound quite right, but I'm not a native speaker. I guess I'd have to grep some larger corpus of English text for more examples of similar context. danfe: > No, it's still 'a structure', not 'an structure'.
This is really news to me, //a Elf… | |||||||||||||
Not Done Inline ActionsI agree with everyone saying "an". Consider: pauamma_gundo.com: I agree with everyone saying "an". Consider:
a structure
a large structure
an awkward structure… | |||||||||||||
Done Inline Actions
These are functions and need .Fn in front of them as is documented in mdoc(7). You might also wanna reflow the sentence. debdrup: These are functions and need .Fn in front of them as is documented in mdoc(7).
You might also… | |||||||||||||
Done Inline ActionsIs .Fn correct, or should this be .Vt? emaste: Is `.Fn` correct, or should this be `.Vt`? | |||||||||||||
Not Done Inline Actions
Oh, you're right that it's not a function - but is it a variable name (Va) rather than a vatiable type (Vt)? debdrup: > Is `.Fn` correct, or should this be `.Vt`?
Oh, you're right that it's not a function - but… | |||||||||||||
Not Done Inline ActionsThe correct phrase is 'an Elf64_Chrdr or Elf32_Chrdr structure'. The rule is to use 'a' in front of words that don't start with a vowel sound, and 'an' in front of words that start with a vowel sound. Words further away don't matter. It is the rule I learned in school. I also checked with my wife, who has a masters degree in English and taught college English for a time to confirm this rule. In this case, it's in front of 'Elf' which starts with the 'E' sounds so it should be 'an Elf'. This is true if you say 'elf' or 'ee el eff' for the name of the structure. See also https://www.thesaurus.com/e/grammar/a-vs-an/ or https://www.merriam-webster.com/words-at-play/is-it-a-or-an for two other references that seem credible. imp: The correct phrase is 'an Elf64_Chrdr or Elf32_Chrdr structure'.
The rule is to use 'a' in… | |||||||||||||
.Vt Elf64_Chdr | |||||||||||||
or | |||||||||||||
.Vt Elf32_Chdr structure | |||||||||||||
which encodes the compression algorithm and some characteristics of the | |||||||||||||
uncompressed data. | |||||||||||||
.Bd -literal -offset indent | |||||||||||||
typedef struct { | |||||||||||||
Elf32_Word ch_type; | |||||||||||||
Elf32_Word ch_size; | |||||||||||||
Elf32_Word ch_addralign; | |||||||||||||
} Elf32_Chdr; | |||||||||||||
.Ed | |||||||||||||
.Bd -literal -offset indent | |||||||||||||
typedef struct { | |||||||||||||
Elf64_Word ch_type; | |||||||||||||
Elf64_Word ch_reserved; | |||||||||||||
Elf64_Xword ch_size; | |||||||||||||
Elf64_Xword ch_addralign; | |||||||||||||
} Elf64_Chdr; | |||||||||||||
.Ed | |||||||||||||
.Pp | |||||||||||||
.Bl -tag -width "ch_addralign" -compact | |||||||||||||
.It Dv ch_type | |||||||||||||
The compression algorithm used. | |||||||||||||
A value of | |||||||||||||
.Dv ELFCOMPRESS_ZLIB | |||||||||||||
indicates that the data is compressed using | |||||||||||||
.Xr zlib 3 . | |||||||||||||
.It Dv ch_size | |||||||||||||
The size, in bytes, of the uncompressed section data. | |||||||||||||
This corresponds to the | |||||||||||||
.Sy sh_size | |||||||||||||
field of a section header containing uncompressed data. | |||||||||||||
.It Dv ch_addralign | |||||||||||||
The address alignment of the uncompressed section data. | |||||||||||||
This corresponds to the | |||||||||||||
.Sy sh_addralign | |||||||||||||
field of a section header containing uncompressed data. | |||||||||||||
.El | |||||||||||||
.Pp | |||||||||||||
String table sections hold null-terminated character sequences, commonly | String table sections hold null-terminated character sequences, commonly | ||||||||||||
called strings. | called strings. | ||||||||||||
The object file uses these strings to represent symbol | The object file uses these strings to represent symbol | ||||||||||||
and section names. | and section names. | ||||||||||||
One references a string as an index into the string | One references a string as an index into the string | ||||||||||||
table section. | table section. | ||||||||||||
The first byte, which is index zero, is defined to hold | The first byte, which is index zero, is defined to hold | ||||||||||||
a null character. | a null character. | ||||||||||||
▲ Show 20 Lines • Show All 257 Lines • ▼ Show 20 Lines | |||||||||||||
.El | .El | ||||||||||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||||||||||
.Xr as 1 , | .Xr as 1 , | ||||||||||||
.Xr gdb 1 , | .Xr gdb 1 , | ||||||||||||
.Xr ld 1 , | .Xr ld 1 , | ||||||||||||
.Xr objdump 1 , | .Xr objdump 1 , | ||||||||||||
.Xr readelf 1 , | .Xr readelf 1 , | ||||||||||||
.Xr execve 2 , | .Xr execve 2 , | ||||||||||||
.Xr zlib 3 , | |||||||||||||
.Xr ar 5 , | .Xr ar 5 , | ||||||||||||
.Xr core 5 | .Xr core 5 | ||||||||||||
.Rs | .Rs | ||||||||||||
.%A Hewlett Packard | .%A Hewlett Packard | ||||||||||||
.%B Elf-64 Object File Format | .%B Elf-64 Object File Format | ||||||||||||
.Re | .Re | ||||||||||||
.Rs | .Rs | ||||||||||||
.%A Santa Cruz Operation | .%A Santa Cruz Operation | ||||||||||||
Show All 20 Lines |
an Elf64_...?