1 .\" $OpenBSD: elf.5,v 1.12 2003/10/27 20:23:58 jmc Exp $
2 .\"Copyright (c) 1999 Jeroen Ruigrok van der Werven
3 .\"All rights reserved.
5 .\"Redistribution and use in source and binary forms, with or without
6 .\"modification, are permitted provided that the following conditions
8 .\"1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\"2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\"THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\"ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\"IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\"ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\"FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\"DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\"OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\"HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\"LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\"OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" $FreeBSD: src/share/man/man5/elf.5,v 1.21 2001/10/01 16:09:23 ru Exp $
28 .\" Slightly adapted - aeb, 2004-01-01
29 .\" 2005-07-15, Mike Frysinger <vapier@gentoo.org>, various fixes
30 .\" 2007-10-11, Mike Frysinger <vapier@gentoo.org>, various fixes
31 .\" 2007-12-08, mtk, Converted from mdoc to man macros
33 .TH ELF 5 2010-06-19 "Linux" "Linux Programmer's Manual"
35 elf \- format of Executable and Linking Format (ELF) files
38 .\" .B #include <elf_abi.h>
44 defines the format of ELF executable binary files.
45 Amongst these files are
46 normal executable files, relocatable object files, core files and shared
49 An executable file using the ELF file format consists of an ELF header,
50 followed by a program header table or a section header table, or both.
51 The ELF header is always at offset zero of the file.
53 table and the section header table's offset in the file are defined in the
55 The two tables describe the rest of the particularities of
58 .\" Applications which wish to process ELF binary files for their native
59 .\" architecture only should include
61 .\" in their source code.
62 .\" These applications should need to refer to
63 .\" all the types and structures by their generic names
65 .\" and to the macros by
67 .\" Applications written this way can be compiled on any architecture,
68 .\" regardless of whether the host is 32-bit or 64-bit.
70 .\" Should an application need to process ELF files of an unknown
71 .\" architecture, then the application needs to explicitly use either
75 .\" type and structure names.
76 .\" Likewise, the macros need to be identified by
81 This header file describes the above mentioned headers as C structures
82 and also includes structures for dynamic sections, relocation sections and
85 The following types are used for N-bit architectures (N=32,64,
99 ElfN_Addr Unsigned program address, uintN_t
100 ElfN_Off Unsigned file offset, uintN_t
101 ElfN_Section Unsigned section index, uint16_t
102 ElfN_Versym Unsigned version symbol information, uint16_t
103 Elf_Byte unsigned char
109 .\" Elf32_Size Unsigned object size
113 (Note: The *BSD terminology is a bit different.
123 In order to avoid confusion these types are replaced by explicit ones
126 All data structures that the file format defines follow the
128 size and alignment guidelines for the relevant class.
130 data structures contain explicit padding to ensure 4-byte alignment
131 for 4-byte objects, to force structure sizes to a multiple of 4, etc.
133 The ELF header is described by the type
143 unsigned char e_ident[EI_NIDENT];
152 uint16_t e_phentsize;
154 uint16_t e_shentsize;
161 The fields have the following meanings:
162 .\" .Bl -tag -width "e_phentsize"
165 This array of bytes specifies to interpret the file,
166 independent of the processor or the file's remaining contents.
167 Within this array everything is named by macros, which start with
170 and may contain values which start with the prefix
172 The following macros are defined:
174 .\" .Bl -tag -width "EI_VERSION" \" EI_ABIVERSION
177 The first byte of the magic number.
178 It must be filled with
183 The second byte of the magic number.
184 It must be filled with
189 The third byte of the magic number.
190 It must be filled with
195 The fourth byte of the magic number.
196 It must be filled with
201 The fifth byte identifies the architecture for this binary:
203 .\" .Bl -tag -width "ELFCLASSNONE" -compact
207 This class is invalid.
210 This defines the 32-bit architecture.
211 It supports machines with files
212 and virtual address spaces up to 4 Gigabytes.
215 This defines the 64-bit architecture.
221 The sixth byte specifies the data encoding of the processor-specific
223 Currently these encodings are supported:
224 .\" .Bl -tag -width "ELFDATA2LSB" -compact
232 Two's complement, little-endian.
235 Two's complement, big-endian.
242 The version number of the ELF specification:
243 .\" .Bl -tag -width "EV_CURRENT" -compact
256 This byte identifies the operating system
257 and ABI to which the object is targeted.
258 Some fields in other ELF structures have flags
259 and values that have platform-specific meanings;
260 the interpretation of those fields is determined by the value of this byte.
262 .\" .Bl -tag -width "ELFOSABI_STANDALONE" -compact
267 Same as ELFOSABI_SYSV
273 .\" synonym: ELFOSABI_NONE
287 .\" .BR ELFOSABI_HURD
291 .\" .BR ELFOSABI_86OPEN
292 .\" 86Open Common IA32 ABI.
299 .\" .BR ELFOSABI_MONTEREY
300 .\" Monterey project ABI. Now replaced by
321 ARM architecture ABI.
324 .BR ELFOSABI_STANDALONE
325 Stand-alone (embedded) ABI.
332 This byte identifies the version of the ABI
333 to which the object is targeted.
334 This field is used to distinguish among incompatible versions of an ABI.
335 The interpretation of this version number
336 is dependent on the ABI identified by the
339 Applications conforming to this specification use the value 0.
343 These bytes are reserved and set to zero.
345 which read them should ignore them.
349 the future if currently unused bytes are given meanings.
350 .\" As reported by Yuri Kozlov and confirmed by Mike Frysinger, EI_BRAND is
351 .\" not in GABI (http://www.sco.com/developers/gabi/latest/ch4.eheader.html)
352 .\" It looks to be a BSDism
355 .\" Start of architecture identification.
365 This member of the structure identifies the object file type:
367 .\" .Bl -tag -width "ET_NONE" -compact
389 This member specifies the required architecture for an individual file.
392 .\" .Bl -tag -width "EM_MIPS_RS4_BE" -compact
404 Sun Microsystems SPARC.
428 MIPS RS3000 (big-endian only).
433 .\" .BR EM_MIPS_RS4_BE
434 .\" MIPS RS4000 (big-endian only). Deprecated.
436 .\" EM_MIPS_RS3_LE (MIPS R3000 little-endian)
444 SPARC with enhanced instruction set.
460 Advanced RISC Machines
486 .\" Compaq [DEC] Alpha.
489 .\" Compaq [DEC] Alpha with enhanced instruction set.
495 This member identifies the file version:
496 .\" .Bl -tag -width "EV_CURRENT" -compact
510 This member gives the virtual address to which the system first transfers
511 control, thus starting the process.
512 If the file has no associated entry
513 point, this member holds zero.
516 This member holds the program header table's file offset in bytes.
518 the file has no program header table, this member holds zero.
521 This member holds the section header table's file offset in bytes.
523 file has no section header table this member holds zero.
526 This member holds processor-specific flags associated with the file.
527 Flag names take the form EF_`machine_flag'.
528 Currently no flags have been defined.
531 This member holds the ELF header's size in bytes.
534 This member holds the size in bytes of one entry in the file's program header
535 table; all entries are the same size.
538 This member holds the number of entries in the program header
544 gives the table's size
546 If a file has no program header,
548 holds the value zero.
550 If the number of entries in the program header table is larger than or equal to
551 .\" This is a Linux extension, added in Linux 2.6.34.
553 (0xffff), this member holds
555 (0xffff) and the real number of entries in the program header table is held
558 member of the initial entry in section header table.
561 member of the initial entry contains the value zero.
562 .\" .Bl -tag -width "PN_XNUM"
566 This is defined as 0xffff, the largest number
568 can have, specifying where the actual number of program headers is assigned.
575 This member holds a sections header's size in bytes.
576 A section header is one
577 entry in the section header table; all entries are the same size.
580 This member holds the number of entries in the section header table.
586 gives the section header table's size in bytes.
587 If a file has no section
590 holds the value of zero.
592 If the number of entries in the section header table is larger than or equal to
596 holds the value zero and the real number of entries in the section header
599 member of the initial entry in section header table.
602 member of the initial entry in the section header table holds the value zero.
605 This member holds the section header table index of the entry associated
606 with the section name string table.
607 If the file has no section name string
608 table, this member holds the value
611 If the index of section name string table section is larger than or equal to
613 (0xff00), this member holds
615 (0xffff) and the real index of the section name string table section
618 member of the initial entry in section header table. Otherwise, the
620 member of the initial entry in section header table contains the value zero.
622 .\" .Bl -tag -width "SHN_LORESERVE"
625 This value marks an undefined, missing, irrelevant, or otherwise meaningless
627 For example, a symbol
629 relative to section number
631 is an undefined symbol.
634 This value specifies the lower bound of the range of reserved indices.
637 Values greater than or equal to
639 are reserved for processor-specific semantics.
642 Values less than or equal to
644 are reserved for processor-specific semantics.
647 This value specifies absolute values for the corresponding reference.
649 example, symbols defined relative to section number
651 have absolute values and are not affected by relocation.
654 Symbols defined relative to this section are common symbols, such as Fortran
655 COMMON or unallocated C external variables.
658 This value specifies the upper bound of the range of reserved
663 inclusive; the values do
664 not reference the section header table.
665 That is, the section header table
668 contain entries for the reserved indices.
673 An executable or shared object file's program header table is an array of
674 structures, each describing a segment or other information the system needs
675 to prepare the program for execution.
680 Program headers are meaningful only for executable and shared object files.
681 A file specifies its own program header size with the ELF header's
686 The ELF program header is described by the type
690 depending on the architecture:
722 The main difference between the 32-bit and the 64-bit program header lies
723 in the location of the
725 member in the total struct.
726 .\" .Bl -tag -width "p_offset"
729 This member of the Phdr struct tells what kind of segment this array
730 element describes or how to interpret the array element's information.
731 .\" .Bl -tag -width "PT_DYNAMIC"
735 The array element is unused and the other members' values are undefined.
736 This lets the program header have ignored entries.
739 The array element specifies a loadable segment, described by
743 The bytes from the file are mapped to the beginning of the memory
745 If the segment's memory size
747 is larger than the file size
751 bytes are defined to hold the value 0 and to follow the segment's
753 The file size may not be larger than the memory size.
754 Loadable segment entries in the program header table appear in ascending
760 The array element specifies dynamic linking information.
763 The array element specifies the location and size of a null-terminated
764 pathname to invoke as an interpreter.
765 This segment type is meaningful
766 only for executable files (though it may occur for shared objects).
767 However it may not occur more than once in a file.
768 If it is present, it must precede any loadable segment entry.
771 The array element specifies the location and size for auxiliary information.
774 This segment type is reserved but has unspecified semantics.
776 contain an array element of this type do not conform to the ABI.
779 The array element, if present, specifies the location and size of the program
780 header table itself, both in the file and in the memory image of the program.
781 This segment type may not occur more than once in a file.
783 only occur if the program header table is part of the memory image of the
785 If it is present, it must precede any loadable segment entry.
788 Values greater than or equal to
790 are reserved for processor-specific semantics.
793 Values less than or equal to
795 are reserved for processor-specific semantics.
798 GNU extension which is used by the Linux kernel to control the state of the
799 stack via the flags set in the
806 This member holds the offset from the beginning of the file at which
807 the first byte of the segment resides.
810 This member holds the virtual address at which the first byte of the
811 segment resides in memory.
814 On systems for which physical addressing is relevant, this member is
815 reserved for the segment's physical address.
819 not used and must be zero.
822 This member holds the number of bytes in the file image of the segment.
826 This member holds the number of bytes in the memory image of the segment.
830 This member holds a bitmask of flags relevant to the segment:
831 .\" .Bl -tag -width "PF_X" -compact
836 An executable segment.
847 A text segment commonly has the flags
851 A data segment commonly has
858 This member holds the value to which the segments are aligned in memory
860 Loadable process segments must have congruent values for
864 modulo the page size.
865 Values of zero and one mean no alignment is required.
868 should be a positive, integral power of two, and
876 A file's section header table lets one locate all the file's sections.
878 section header table is an array of
886 member gives the byte offset from the beginning of the file to the section
889 holds the number of entries the section header table contains.
891 holds the size in bytes of each entry.
893 A section header table index is a subscript into this array.
895 header table indices are reserved:
896 the initial entry and the indices between
900 The initial entry is used in ELF extensions for
905 in other cases, each field in the initial entry is set to zero.
906 An object file does not have sections for
907 these special indices:
908 .\" .Bl -tag -width "SHN_LORESERVE"
912 This value marks an undefined, missing, irrelevant or otherwise meaningless
916 This value specifies the lower bound of the range of reserved indices.
919 Values greater than or equal to
921 are reserved for processor-specific semantics.
924 Values less than or equal to
926 are reserved for processor-specific semantics.
929 This value specifies the absolute value for the corresponding reference.
931 example, a symbol defined relative to section number
933 has an absolute value and is not affected by relocation.
936 Symbols defined relative to this section are common symbols, such as FORTRAN
937 COMMON or unallocated C external variables.
940 This value specifies the upper bound of the range of reserved indices.
942 system reserves indices between
947 The section header table does not contain entries for the
952 The section header has the following structure:
965 uint32_t sh_addralign;
982 uint64_t sh_addralign;
988 No real differences exist between the 32-bit and 64-bit section headers.
989 .\" .Bl -tag -width "sh_addralign"
992 This member specifies the name of the section.
993 Its value is an index
994 into the section header string table section, giving the location of
995 a null-terminated string.
998 This member categorizes the section's contents and semantics.
999 .\" .Bl -tag -width "SHT_PROGBITS"
1003 This value marks the section header as inactive.
1005 have an associated section.
1006 Other members of the section header
1007 have undefined values.
1010 This section holds information defined by the program, whose
1011 format and meaning are determined solely by the program.
1014 This section holds a symbol table.
1017 provides symbols for link editing, though it may also be used
1018 for dynamic linking.
1019 As a complete symbol table, it may contain
1020 many symbols unnecessary for dynamic linking.
1027 This section holds a string table.
1028 An object file may have multiple
1029 string table sections.
1032 This section holds relocation entries with explicit addends, such
1035 for the 32-bit class of object files.
1036 An object may have multiple
1037 relocation sections.
1040 This section holds a symbol hash table.
1041 An object participating in
1042 dynamic linking must contain a symbol hash table.
1044 have only one hash table.
1047 This section holds information for dynamic linking.
1049 have only one dynamic section.
1052 This section holds information that marks the file in some way.
1055 A section of this type occupies no space in the file but otherwise
1058 Although this section contains no bytes, the
1060 member contains the conceptual file offset.
1063 This section holds relocation offsets without explicit addends, such
1066 for the 32-bit class of object files.
1067 An object file may have multiple
1068 relocation sections.
1071 This section is reserved but has unspecified semantics.
1074 This section holds a minimal set of dynamic linking symbols.
1076 object file can also contain a
1081 This value up to and including
1083 is reserved for processor-specific semantics.
1086 This value down to and including
1088 is reserved for processor-specific semantics.
1091 This value specifies the lower bound of the range of indices reserved for
1092 application programs.
1095 This value specifies the upper bound of the range of indices reserved for
1096 application programs.
1097 Section types between
1101 may be used by the application, without conflicting with current or future
1102 system-defined section types.
1107 Sections support one-bit flags that describe miscellaneous attributes.
1108 If a flag bit is set in
1113 Otherwise, the attribute is
1116 Undefined attributes are set to zero.
1117 .\" .Bl -tag -width "SHF_EXECINSTR" -compact
1121 This section contains data that should be writable during process
1125 This section occupies memory during process execution.
1127 sections do not reside in the memory image of an object file.
1129 attribute is off for those sections.
1132 This section contains executable machine instructions.
1135 All bits included in this mask are reserved for processor-specific
1141 If this section appears in the memory image of a process, this member
1142 holds the address at which the section's first byte should reside.
1143 Otherwise, the member contains zero.
1146 This member's value holds the byte offset from the beginning of the file
1147 to the first byte in the section.
1150 occupies no space in the file, and its
1152 member locates the conceptual placement in the file.
1155 This member holds the section's size in bytes.
1156 Unless the section type
1159 the section occupies
1164 may have a nonzero size, but it occupies no space in the file.
1167 This member holds a section header table index link, whose interpretation
1168 depends on the section type.
1171 This member holds extra information, whose interpretation depends on the
1175 Some sections have address alignment constraints.
1176 If a section holds a
1177 doubleword, the system must ensure doubleword alignment for the entire
1179 That is, the value of
1181 must be congruent to zero, modulo the value of
1183 Only zero and positive integral powers of two are allowed.
1185 or one mean the section has no alignment constraints.
1188 Some sections hold a table of fixed-sized entries, such as a symbol table.
1189 For such a section, this member gives the size in bytes for each entry.
1190 This member contains zero if the section does not hold a table of
1194 Various sections hold program and control information:
1195 .\" .Bl -tag -width ".shstrtab"
1198 This section holds uninitialized data that contributes to the program's
1200 By definition, the system initializes the data with zeros
1201 when the program begins to run.
1202 This section is of type
1204 The attribute types are
1210 This section holds version control information.
1211 This section is of type
1213 No attribute types are used.
1216 This section holds initialized pointers to the C++ constructor functions.
1217 This section is of type
1219 The attribute types are
1225 This section holds initialized data that contribute to the program's
1227 This section is of type
1229 The attribute types are
1235 This section holds initialized data that contribute to the program's
1237 This section is of type
1239 The attribute types are
1245 This section holds information for symbolic debugging.
1248 This section is of type
1250 No attribute types are used.
1253 This section holds initialized pointers to the C++ destructor functions.
1254 This section is of type
1256 The attribute types are
1262 This section holds dynamic linking information.
1263 The section's attributes
1269 bit is set is processor-specific.
1270 This section is of type
1272 See the attributes above.
1275 This section holds strings needed for dynamic linking, most commonly
1276 the strings that represent the names associated with symbol table entries.
1277 This section is of type
1279 The attribute type used is
1283 This section holds the dynamic linking symbol table.
1284 This section is of type
1286 The attribute used is
1290 This section holds executable instructions that contribute to the process
1292 When a program exits normally the system arranges to
1293 execute the code in this section.
1294 This section is of type
1296 The attributes used are
1302 This section holds the version symbol table, an array of
1305 This section is of type
1306 .BR SHT_GNU_versym .
1307 The attribute type used is
1311 This section holds the version symbol definitions, a table of
1314 This section is of type
1315 .BR SHT_GNU_verdef .
1316 The attribute type used is
1320 This section holds the version symbol needed elements, a table of
1325 .BR SHT_GNU_versym .
1326 The attribute type used is
1330 This section holds the global offset table.
1331 This section is of type
1333 The attributes are processor specific.
1336 This section holds a symbol hash table.
1337 This section is of type
1339 The attribute used is
1343 This section holds executable instructions that contribute to the process
1344 initialization code.
1345 When a program starts to run the system arranges to
1346 execute the code in this section before calling the main program entry point.
1347 This section is of type
1349 The attributes used are
1355 This section holds the pathname of a program interpreter.
1357 a loadable segment that includes the section, the section's attributes will
1361 Otherwise, that bit will be off.
1362 This section is of type
1366 This section holds line number information for symbolic debugging, which
1367 describes the correspondence between the program source and the machine code.
1368 The contents are unspecified.
1369 This section is of type
1371 No attribute types are used.
1374 This section holds information in the
1377 This section is of type
1379 No attribute types are used.
1381 native executables usually contain a
1382 .I .note.openbsd.ident
1383 section to identify themselves, for the kernel to bypass any compatibility
1384 ELF binary emulation tests when loading the file.
1387 This section is used in Linux object files for declaring stack attributes.
1388 This section is of type
1390 The only attribute used is
1392 This indicates to the GNU linker that the object file requires an
1396 This section holds the procedure linkage table.
1397 This section is of type
1399 The attributes are processor specific.
1402 This section holds relocation information as described below.
1404 has a loadable segment that includes relocation, the section's attributes
1408 Otherwise the bit will be off.
1411 is supplied by the section to which the relocations apply.
1415 normally would have the name
1417 This section is of type
1421 This section holds relocation information as described below.
1423 has a loadable segment that includes relocation, the section's attributes
1427 Otherwise the bit will be off.
1430 is supplied by the section to which the relocations apply.
1434 normally would have the name
1436 This section is of type
1440 This section holds read-only data that typically contributes to a
1441 nonwritable segment in the process image.
1442 This section is of type
1444 The attribute used is
1448 This section holds read-only data that typically contributes to a
1449 nonwritable segment in the process image.
1450 This section is of type
1452 The attribute used is
1456 This section holds section names.
1457 This section is of type
1459 No attribute types are used.
1462 This section holds strings, most commonly the strings that represent the
1463 names associated with symbol table entries.
1464 If the file has a loadable
1465 segment that includes the symbol string table, the section's attributes
1469 Otherwise the bit will be off.
1470 This section is of type
1474 This section holds a symbol table.
1475 If the file has a loadable segment
1476 that includes the symbol table, the section's attributes will include
1480 Otherwise the bit will be off.
1481 This section is of type
1485 This section holds the
1487 or executable instructions, of a program.
1488 This section is of type
1490 The attributes used are
1496 String table sections hold null-terminated character sequences, commonly
1498 The object file uses these strings to represent symbol
1500 One references a string as an index into the string
1502 The first byte, which is index zero, is defined to hold
1503 a null byte (\(aq\\0\(aq).
1504 Similarly, a string table's last byte is defined to
1505 hold a null byte, ensuring null termination for all strings.
1507 An object file's symbol table holds information needed to locate and
1508 relocate a program's symbolic definitions and references.
1510 index is a subscript into this array.
1516 Elf32_Addr st_value;
1518 unsigned char st_info;
1519 unsigned char st_other;
1529 unsigned char st_info;
1530 unsigned char st_other;
1532 Elf64_Addr st_value;
1538 The 32-bit and 64-bit versions have the same members, just in a different
1540 .\" .Bl -tag -width "st_value"
1543 This member holds an index into the object file's symbol string table,
1544 which holds character representations of the symbol names.
1546 is nonzero, it represents a string table index that gives the symbol
1548 Otherwise, the symbol table has no name.
1551 This member gives the value of the associated symbol.
1554 Many symbols have associated sizes.
1555 This member holds zero if the symbol
1556 has no size or an unknown size.
1559 This member specifies the symbol's type and binding attributes:
1560 .\" .Bl -tag -width "STT_SECTION"
1564 The symbol's type is not defined.
1567 The symbol is associated with a data object.
1570 The symbol is associated with a function or other executable code.
1573 The symbol is associated with a section.
1574 Symbol table entries of
1575 this type exist primarily for relocation and normally have
1580 By convention, the symbol's name gives the name of the source file
1581 associated with the object file.
1584 bindings, its section index is
1586 and it precedes the other
1588 symbols of the file, if it is present.
1591 This value up to and including
1593 is reserved for processor-specific semantics.
1596 This value down to and including
1598 is reserved for processor-specific semantics.
1600 .\" .Bl -tag -width "STB_GLOBAL"
1603 Local symbols are not visible outside the object file containing their
1605 Local symbols of the same name may exist in multiple files
1606 without interfering with each other.
1609 Global symbols are visible to all object files being combined.
1611 definition of a global symbol will satisfy another file's undefined
1612 reference to the same symbol.
1615 Weak symbols resemble global symbols, but their definitions have lower
1619 This value up to and including
1621 is reserved for processor-specific semantics.
1624 This value down to and including
1626 is reserved for processor-specific semantics.
1628 There are macros for packing and unpacking the binding and type fields:
1630 .BR ELF32_ST_BIND (info)
1632 .BR ELF64_ST_BIND (info)
1633 extract a binding from an
1637 .BR ELF32_ST_TYPE (info)
1639 .BR ELF64_ST_TYPE (info)
1641 extract a type from an
1645 .BR ELF32_ST_INFO "(bind, type)"
1647 .BR ELF64_ST_INFO "(bind, type)"
1649 convert a binding and a type into an
1656 This member defines the symbol visibility.
1657 .\" .Bl -tag -width "STV_PROTECTED"
1662 Default symbol visibility rules.
1665 Processor-specific hidden class.
1668 Symbol is unavailable in other modules.
1671 Not preemptible, not exported.
1674 There are macros for extracting the visibility type:
1676 .BR ELF32_ST_VISIBILITY (other)
1678 .BR ELF64_ST_VISIBILITY (other)
1683 Every symbol table entry is
1685 in relation to some section.
1686 This member holds the relevant section
1690 Relocation is the process of connecting symbolic references with
1691 symbolic definitions.
1692 Relocatable files must have information that
1693 describes how to modify their section contents, thus allowing executable
1694 and shared object files to hold the right information for a process's
1696 Relocation entries are these data.
1698 Relocation structures that do not need an addend:
1703 Elf32_Addr r_offset;
1712 Elf64_Addr r_offset;
1718 Relocation structures that need an addend:
1723 Elf32_Addr r_offset;
1733 Elf64_Addr r_offset;
1739 .\" .Bl -tag -width "r_offset"
1742 This member gives the location at which to apply the relocation action.
1743 For a relocatable file, the value is the byte offset from the beginning
1744 of the section to the storage unit affected by the relocation.
1746 executable file or shared object, the value is the virtual address of
1747 the storage unit affected by the relocation.
1750 This member gives both the symbol table index with respect to which the
1751 relocation must be made and the type of relocation to apply.
1753 types are processor specific.
1754 When the text refers to a relocation
1755 entry's relocation type or symbol table index, it means the result of
1757 .BR ELF_[32|64]_R_TYPE
1759 .BR ELF[32|64]_R_SYM ,
1760 respectively, to the entry's
1765 This member specifies a constant addend used to compute the value to be
1766 stored into the relocatable field.
1769 The .dynamic section contains a series of structures that hold relevant
1770 dynamic linking information.
1771 The d_tag member controls the interpretation
1783 extern Elf32_Dyn _DYNAMIC[];
1796 extern Elf64_Dyn _DYNAMIC[];
1799 .\" .Bl -tag -width "d_tag"
1802 This member may have any of the following values:
1803 .\" .Bl -tag -width "DT_SYMBOLIC"
1807 Marks end of dynamic section
1810 String table offset to name of a needed library
1813 Size in bytes of PLT relocs
1816 Address of PLT and/or GOT
1819 Address of symbol hash table
1822 Address of string table
1825 Address of symbol table
1828 Address of Rela relocs table
1831 Size in bytes of Rela table
1834 Size in bytes of a Rela table entry
1837 Size in bytes of string table
1840 Size in bytes of a symbol table entry
1843 Address of the initialization function
1846 Address of the termination function
1849 String table offset to name of shared object
1852 String table offset to library search path (deprecated)
1855 Alert linker to search this shared object before the executable for symbols
1858 Address of Rel relocs table
1861 Size in bytes of Rel table
1864 Size in bytes of a Rel table entry
1867 Type of reloc the PLT refers (Rela or Rel)
1870 Undefined use for debugging
1873 Absence of this indicates no relocs should apply to a nonwritable segment
1876 Address of reloc entries solely for the PLT
1879 Instruct dynamic linker to process all relocs before transferring control to
1883 String table offset to library search path
1886 Start of processor-specific semantics
1889 End of processor-specific semantics
1894 This member represents integer values with various interpretations.
1897 This member represents program virtual addresses.
1899 these addresses, the actual address should be computed based on the
1900 original file value and memory base address.
1901 Files do not contain
1902 relocation entries to fixup these addresses.
1905 Array containing all the dynamic structures in the .dynamic section.
1906 This is automatically populated by the linker.
1910 .\" ELF support first appeared in
1912 .\" although not all supported platforms use it as the native
1913 .\" binary file format.
1914 ELF first appeared in
1916 The ELF format is an adopted standard.
1925 Sun, BSD and AMD64 also support them; for further information,
1926 look under SEE ALSO.
1928 .\" The original version of this manual page was written by
1929 .\" .An Jeroen Ruigrok van der Werven
1930 .\" .Aq asmodai@FreeBSD.org
1931 .\" with inspiration from BSDi's
1944 .IR "Elf-64 Object File Format" .
1946 Santa Cruz Operation,
1947 .IR "System V Application Binary Interface" .
1949 UNIX System Laboratories,
1951 .IR "Executable and Linking Format (ELF)" .
1954 .IR "Linker and Libraries Guide" .
1957 .IR "System V Application Binary Interface AMD64 Architecture Processor Supplement" .