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 .\" %%%LICENSE_START(PERMISSIVE_MISC)
6 .\"Redistribution and use in source and binary forms, with or without
7 .\"modification, are permitted provided that the following conditions
9 .\"1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\"2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\"THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 .\"ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\"IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\"ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\"FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\"DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\"OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\"HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\"LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\"OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" $FreeBSD: src/share/man/man5/elf.5,v 1.21 2001/10/01 16:09:23 ru Exp $
30 .\" Slightly adapted - aeb, 2004-01-01
31 .\" 2005-07-15, Mike Frysinger <vapier@gentoo.org>, various fixes
32 .\" 2007-10-11, Mike Frysinger <vapier@gentoo.org>, various fixes
33 .\" 2007-12-08, mtk, Converted from mdoc to man macros
35 .TH ELF 5 2013-04-17 "Linux" "Linux Programmer's Manual"
37 elf \- format of Executable and Linking Format (ELF) files
40 .\" .B #include <elf_abi.h>
46 defines the format of ELF executable binary files.
47 Amongst these files are
48 normal executable files, relocatable object files, core files and shared
51 An executable file using the ELF file format consists of an ELF header,
52 followed by a program header table or a section header table, or both.
53 The ELF header is always at offset zero of the file.
55 table and the section header table's offset in the file are defined in the
57 The two tables describe the rest of the particularities of
60 .\" Applications which wish to process ELF binary files for their native
61 .\" architecture only should include
63 .\" in their source code.
64 .\" These applications should need to refer to
65 .\" all the types and structures by their generic names
67 .\" and to the macros by
69 .\" Applications written this way can be compiled on any architecture,
70 .\" regardless of whether the host is 32-bit or 64-bit.
72 .\" Should an application need to process ELF files of an unknown
73 .\" architecture, then the application needs to explicitly use either
77 .\" type and structure names.
78 .\" Likewise, the macros need to be identified by
83 This header file describes the above mentioned headers as C structures
84 and also includes structures for dynamic sections, relocation sections and
87 The following types are used for N-bit architectures (N=32,64,
101 ElfN_Addr Unsigned program address, uintN_t
102 ElfN_Off Unsigned file offset, uintN_t
103 ElfN_Section Unsigned section index, uint16_t
104 ElfN_Versym Unsigned version symbol information, uint16_t
105 Elf_Byte unsigned char
111 .\" Elf32_Size Unsigned object size
115 (Note: The *BSD terminology is a bit different.
125 In order to avoid confusion these types are replaced by explicit ones
128 All data structures that the file format defines follow the
130 size and alignment guidelines for the relevant class.
132 data structures contain explicit padding to ensure 4-byte alignment
133 for 4-byte objects, to force structure sizes to a multiple of 4, and so on.
135 The ELF header is described by the type
145 unsigned char e_ident[EI_NIDENT];
154 uint16_t e_phentsize;
156 uint16_t e_shentsize;
163 The fields have the following meanings:
164 .\" .Bl -tag -width "e_phentsize"
167 This array of bytes specifies to interpret the file,
168 independent of the processor or the file's remaining contents.
169 Within this array everything is named by macros, which start with
172 and may contain values which start with the prefix
174 The following macros are defined:
176 .\" .Bl -tag -width "EI_VERSION" \" EI_ABIVERSION
179 The first byte of the magic number.
180 It must be filled with
185 The second byte of the magic number.
186 It must be filled with
191 The third byte of the magic number.
192 It must be filled with
197 The fourth byte of the magic number.
198 It must be filled with
203 The fifth byte identifies the architecture for this binary:
205 .\" .Bl -tag -width "ELFCLASSNONE" -compact
209 This class is invalid.
212 This defines the 32-bit architecture.
213 It supports machines with files
214 and virtual address spaces up to 4 Gigabytes.
217 This defines the 64-bit architecture.
223 The sixth byte specifies the data encoding of the processor-specific
225 Currently these encodings are supported:
226 .\" .Bl -tag -width "ELFDATA2LSB" -compact
234 Two's complement, little-endian.
237 Two's complement, big-endian.
244 The seventh byte is the version number of the ELF specification:
245 .\" .Bl -tag -width "EV_CURRENT" -compact
258 The eighth byte identifies the operating system
259 and ABI to which the object is targeted.
260 Some fields in other ELF structures have flags
261 and values that have platform-specific meanings;
262 the interpretation of those fields is determined by the value of this byte.
264 .\" .Bl -tag -width "ELFOSABI_STANDALONE" -compact
269 Same as ELFOSABI_SYSV
275 .\" synonym: ELFOSABI_NONE
289 .\" .BR ELFOSABI_HURD
293 .\" .BR ELFOSABI_86OPEN
294 .\" 86Open Common IA32 ABI.
301 .\" .BR ELFOSABI_MONTEREY
302 .\" Monterey project ABI.
324 ARM architecture ABI.
327 .BR ELFOSABI_STANDALONE
328 Stand-alone (embedded) ABI.
335 The ninth byte identifies the version of the ABI
336 to which the object is targeted.
337 This field is used to distinguish among incompatible versions of an ABI.
338 The interpretation of this version number
339 is dependent on the ABI identified by the
342 Applications conforming to this specification use the value 0.
346 These bytes are reserved and set to zero.
348 which read them should ignore them.
352 the future if currently unused bytes are given meanings.
353 .\" As reported by Yuri Kozlov and confirmed by Mike Frysinger, EI_BRAND is
354 .\" not in GABI (http://www.sco.com/developers/gabi/latest/ch4.eheader.html)
355 .\" It looks to be a BSDism
358 .\" Start of architecture identification.
368 This member of the structure identifies the object file type:
370 .\" .Bl -tag -width "ET_NONE" -compact
392 This member specifies the required architecture for an individual file.
395 .\" .Bl -tag -width "EM_MIPS_RS4_BE" -compact
407 Sun Microsystems SPARC.
431 MIPS RS3000 (big-endian only).
436 .\" .BR EM_MIPS_RS4_BE
437 .\" MIPS RS4000 (big-endian only). Deprecated.
439 .\" EM_MIPS_RS3_LE (MIPS R3000 little-endian)
447 SPARC with enhanced instruction set.
463 Advanced RISC Machines
489 .\" Compaq [DEC] Alpha.
492 .\" Compaq [DEC] Alpha with enhanced instruction set.
498 This member identifies the file version:
499 .\" .Bl -tag -width "EV_CURRENT" -compact
513 This member gives the virtual address to which the system first transfers
514 control, thus starting the process.
515 If the file has no associated entry
516 point, this member holds zero.
519 This member holds the program header table's file offset in bytes.
521 the file has no program header table, this member holds zero.
524 This member holds the section header table's file offset in bytes.
526 file has no section header table, this member holds zero.
529 This member holds processor-specific flags associated with the file.
530 Flag names take the form EF_`machine_flag'.
531 Currently no flags have been defined.
534 This member holds the ELF header's size in bytes.
537 This member holds the size in bytes of one entry in the file's program header
538 table; all entries are the same size.
541 This member holds the number of entries in the program header
547 gives the table's size
549 If a file has no program header,
551 holds the value zero.
553 If the number of entries in the program header table is larger than or equal to
554 .\" This is a Linux extension, added in Linux 2.6.34.
556 (0xffff), this member holds
558 (0xffff) and the real number of entries in the program header table is held
561 member of the initial entry in section header table.
564 member of the initial entry contains the value zero.
565 .\" .Bl -tag -width "PN_XNUM"
569 This is defined as 0xffff, the largest number
571 can have, specifying where the actual number of program headers is assigned.
578 This member holds a sections header's size in bytes.
579 A section header is one
580 entry in the section header table; all entries are the same size.
583 This member holds the number of entries in the section header table.
589 gives the section header table's size in bytes.
590 If a file has no section
593 holds the value of zero.
595 If the number of entries in the section header table is larger than or equal to
599 holds the value zero and the real number of entries in the section header
602 member of the initial entry in section header table.
605 member of the initial entry in the section header table holds the value zero.
608 This member holds the section header table index of the entry associated
609 with the section name string table.
610 If the file has no section name string
611 table, this member holds the value
614 If the index of section name string table section is larger than or equal to
616 (0xff00), this member holds
618 (0xffff) and the real index of the section name string table section
621 member of the initial entry in section header table.
624 member of the initial entry in section header table contains the value zero.
626 .\" .Bl -tag -width "SHN_LORESERVE"
629 This value marks an undefined, missing, irrelevant, or otherwise meaningless
631 For example, a symbol
633 relative to section number
635 is an undefined symbol.
638 This value specifies the lower bound of the range of reserved indices.
641 Values greater than or equal to
643 are reserved for processor-specific semantics.
646 Values less than or equal to
648 are reserved for processor-specific semantics.
651 This value specifies absolute values for the corresponding reference.
653 example, symbols defined relative to section number
655 have absolute values and are not affected by relocation.
658 Symbols defined relative to this section are common symbols, such as Fortran
659 COMMON or unallocated C external variables.
662 This value specifies the upper bound of the range of reserved
667 inclusive; the values do
668 not reference the section header table.
669 That is, the section header table
672 contain entries for the reserved indices.
677 An executable or shared object file's program header table is an array of
678 structures, each describing a segment or other information the system needs
679 to prepare the program for execution.
684 Program headers are meaningful only for executable and shared object files.
685 A file specifies its own program header size with the ELF header's
690 The ELF program header is described by the type
694 depending on the architecture:
726 The main difference between the 32-bit and the 64-bit program header lies
727 in the location of the
729 member in the total struct.
730 .\" .Bl -tag -width "p_offset"
733 This member of the Phdr struct tells what kind of segment this array
734 element describes or how to interpret the array element's information.
735 .\" .Bl -tag -width "PT_DYNAMIC"
739 The array element is unused and the other members' values are undefined.
740 This lets the program header have ignored entries.
743 The array element specifies a loadable segment, described by
747 The bytes from the file are mapped to the beginning of the memory
749 If the segment's memory size
751 is larger than the file size
755 bytes are defined to hold the value 0 and to follow the segment's
757 The file size may not be larger than the memory size.
758 Loadable segment entries in the program header table appear in ascending
764 The array element specifies dynamic linking information.
767 The array element specifies the location and size of a null-terminated
768 pathname to invoke as an interpreter.
769 This segment type is meaningful
770 only for executable files (though it may occur for shared objects).
771 However it may not occur more than once in a file.
772 If it is present, it must precede any loadable segment entry.
775 The array element specifies the location and size for auxiliary information.
778 This segment type is reserved but has unspecified semantics.
780 contain an array element of this type do not conform to the ABI.
783 The array element, if present, specifies the location and size of the program
784 header table itself, both in the file and in the memory image of the program.
785 This segment type may not occur more than once in a file.
787 occur only if the program header table is part of the memory image of the
789 If it is present, it must precede any loadable segment entry.
792 Values greater than or equal to
794 are reserved for processor-specific semantics.
797 Values less than or equal to
799 are reserved for processor-specific semantics.
802 GNU extension which is used by the Linux kernel to control the state of the
803 stack via the flags set in the
810 This member holds the offset from the beginning of the file at which
811 the first byte of the segment resides.
814 This member holds the virtual address at which the first byte of the
815 segment resides in memory.
818 On systems for which physical addressing is relevant, this member is
819 reserved for the segment's physical address.
823 not used and must be zero.
826 This member holds the number of bytes in the file image of the segment.
830 This member holds the number of bytes in the memory image of the segment.
834 This member holds a bit mask of flags relevant to the segment:
835 .\" .Bl -tag -width "PF_X" -compact
840 An executable segment.
851 A text segment commonly has the flags
855 A data segment commonly has
862 This member holds the value to which the segments are aligned in memory
864 Loadable process segments must have congruent values for
868 modulo the page size.
869 Values of zero and one mean no alignment is required.
872 should be a positive, integral power of two, and
880 A file's section header table lets one locate all the file's sections.
882 section header table is an array of
890 member gives the byte offset from the beginning of the file to the section
893 holds the number of entries the section header table contains.
895 holds the size in bytes of each entry.
897 A section header table index is a subscript into this array.
899 header table indices are reserved:
900 the initial entry and the indices between
904 The initial entry is used in ELF extensions for
909 in other cases, each field in the initial entry is set to zero.
910 An object file does not have sections for
911 these special indices:
912 .\" .Bl -tag -width "SHN_LORESERVE"
916 This value marks an undefined, missing, irrelevant, or otherwise meaningless
920 This value specifies the lower bound of the range of reserved indices.
923 Values greater than or equal to
925 are reserved for processor-specific semantics.
928 Values less than or equal to
930 are reserved for processor-specific semantics.
933 This value specifies the absolute value for the corresponding reference.
935 example, a symbol defined relative to section number
937 has an absolute value and is not affected by relocation.
940 Symbols defined relative to this section are common symbols, such as FORTRAN
941 COMMON or unallocated C external variables.
944 This value specifies the upper bound of the range of reserved indices.
946 system reserves indices between
951 The section header table does not contain entries for the
956 The section header has the following structure:
969 uint32_t sh_addralign;
986 uint64_t sh_addralign;
992 No real differences exist between the 32-bit and 64-bit section headers.
993 .\" .Bl -tag -width "sh_addralign"
996 This member specifies the name of the section.
997 Its value is an index
998 into the section header string table section, giving the location of
999 a null-terminated string.
1002 This member categorizes the section's contents and semantics.
1003 .\" .Bl -tag -width "SHT_PROGBITS"
1007 This value marks the section header as inactive.
1009 have an associated section.
1010 Other members of the section header
1011 have undefined values.
1014 This section holds information defined by the program, whose
1015 format and meaning are determined solely by the program.
1018 This section holds a symbol table.
1021 provides symbols for link editing, though it may also be used
1022 for dynamic linking.
1023 As a complete symbol table, it may contain
1024 many symbols unnecessary for dynamic linking.
1031 This section holds a string table.
1032 An object file may have multiple
1033 string table sections.
1036 This section holds relocation entries with explicit addends, such
1039 for the 32-bit class of object files.
1040 An object may have multiple
1041 relocation sections.
1044 This section holds a symbol hash table.
1045 An object participating in
1046 dynamic linking must contain a symbol hash table.
1048 have only one hash table.
1051 This section holds information for dynamic linking.
1053 have only one dynamic section.
1056 This section holds information that marks the file in some way.
1059 A section of this type occupies no space in the file but otherwise
1062 Although this section contains no bytes, the
1064 member contains the conceptual file offset.
1067 This section holds relocation offsets without explicit addends, such
1070 for the 32-bit class of object files.
1071 An object file may have multiple
1072 relocation sections.
1075 This section is reserved but has unspecified semantics.
1078 This section holds a minimal set of dynamic linking symbols.
1080 object file can also contain a
1085 This value up to and including
1087 is reserved for processor-specific semantics.
1090 This value down to and including
1092 is reserved for processor-specific semantics.
1095 This value specifies the lower bound of the range of indices reserved for
1096 application programs.
1099 This value specifies the upper bound of the range of indices reserved for
1100 application programs.
1101 Section types between
1105 may be used by the application, without conflicting with current or future
1106 system-defined section types.
1111 Sections support one-bit flags that describe miscellaneous attributes.
1112 If a flag bit is set in
1117 Otherwise, the attribute is
1120 Undefined attributes are set to zero.
1121 .\" .Bl -tag -width "SHF_EXECINSTR" -compact
1125 This section contains data that should be writable during process
1129 This section occupies memory during process execution.
1131 sections do not reside in the memory image of an object file.
1133 attribute is off for those sections.
1136 This section contains executable machine instructions.
1139 All bits included in this mask are reserved for processor-specific
1145 If this section appears in the memory image of a process, this member
1146 holds the address at which the section's first byte should reside.
1147 Otherwise, the member contains zero.
1150 This member's value holds the byte offset from the beginning of the file
1151 to the first byte in the section.
1154 occupies no space in the file, and its
1156 member locates the conceptual placement in the file.
1159 This member holds the section's size in bytes.
1160 Unless the section type
1163 the section occupies
1168 may have a nonzero size, but it occupies no space in the file.
1171 This member holds a section header table index link, whose interpretation
1172 depends on the section type.
1175 This member holds extra information, whose interpretation depends on the
1179 Some sections have address alignment constraints.
1180 If a section holds a
1181 doubleword, the system must ensure doubleword alignment for the entire
1183 That is, the value of
1185 must be congruent to zero, modulo the value of
1187 Only zero and positive integral powers of two are allowed.
1189 or one mean the section has no alignment constraints.
1192 Some sections hold a table of fixed-sized entries, such as a symbol table.
1193 For such a section, this member gives the size in bytes for each entry.
1194 This member contains zero if the section does not hold a table of
1198 Various sections hold program and control information:
1199 .\" .Bl -tag -width ".shstrtab"
1202 This section holds uninitialized data that contributes to the program's
1204 By definition, the system initializes the data with zeros
1205 when the program begins to run.
1206 This section is of type
1208 The attribute types are
1214 This section holds version control information.
1215 This section is of type
1217 No attribute types are used.
1220 This section holds initialized pointers to the C++ constructor functions.
1221 This section is of type
1223 The attribute types are
1229 This section holds initialized data that contribute to the program's
1231 This section is of type
1233 The attribute types are
1239 This section holds initialized data that contribute to the program's
1241 This section is of type
1243 The attribute types are
1249 This section holds information for symbolic debugging.
1252 This section is of type
1254 No attribute types are used.
1257 This section holds initialized pointers to the C++ destructor functions.
1258 This section is of type
1260 The attribute types are
1266 This section holds dynamic linking information.
1267 The section's attributes
1273 bit is set is processor-specific.
1274 This section is of type
1276 See the attributes above.
1279 This section holds strings needed for dynamic linking, most commonly
1280 the strings that represent the names associated with symbol table entries.
1281 This section is of type
1283 The attribute type used is
1287 This section holds the dynamic linking symbol table.
1288 This section is of type
1290 The attribute used is
1294 This section holds executable instructions that contribute to the process
1296 When a program exits normally the system arranges to
1297 execute the code in this section.
1298 This section is of type
1300 The attributes used are
1306 This section holds the version symbol table, an array of
1309 This section is of type
1310 .BR SHT_GNU_versym .
1311 The attribute type used is
1315 This section holds the version symbol definitions, a table of
1318 This section is of type
1319 .BR SHT_GNU_verdef .
1320 The attribute type used is
1324 This section holds the version symbol needed elements, a table of
1329 .BR SHT_GNU_versym .
1330 The attribute type used is
1334 This section holds the global offset table.
1335 This section is of type
1337 The attributes are processor-specific.
1340 This section holds a symbol hash table.
1341 This section is of type
1343 The attribute used is
1347 This section holds executable instructions that contribute to the process
1348 initialization code.
1349 When a program starts to run the system arranges to
1350 execute the code in this section before calling the main program entry point.
1351 This section is of type
1353 The attributes used are
1359 This section holds the pathname of a program interpreter.
1361 a loadable segment that includes the section, the section's attributes will
1365 Otherwise, that bit will be off.
1366 This section is of type
1370 This section holds line number information for symbolic debugging, which
1371 describes the correspondence between the program source and the machine code.
1372 The contents are unspecified.
1373 This section is of type
1375 No attribute types are used.
1378 This section holds information in the
1381 This section is of type
1383 No attribute types are used.
1385 native executables usually contain a
1386 .I .note.openbsd.ident
1387 section to identify themselves, for the kernel to bypass any compatibility
1388 ELF binary emulation tests when loading the file.
1391 This section is used in Linux object files for declaring stack attributes.
1392 This section is of type
1394 The only attribute used is
1396 This indicates to the GNU linker that the object file requires an
1400 This section holds the procedure linkage table.
1401 This section is of type
1403 The attributes are processor-specific.
1406 This section holds relocation information as described below.
1408 has a loadable segment that includes relocation, the section's attributes
1412 Otherwise, the bit will be off.
1415 is supplied by the section to which the relocations apply.
1419 normally would have the name
1421 This section is of type
1425 This section holds relocation information as described below.
1427 has a loadable segment that includes relocation, the section's attributes
1431 Otherwise, the bit will be off.
1434 is supplied by the section to which the relocations apply.
1438 normally would have the name
1440 This section is of type
1444 This section holds read-only data that typically contributes to a
1445 nonwritable segment in the process image.
1446 This section is of type
1448 The attribute used is
1452 This section holds read-only data that typically contributes to a
1453 nonwritable segment in the process image.
1454 This section is of type
1456 The attribute used is
1460 This section holds section names.
1461 This section is of type
1463 No attribute types are used.
1466 This section holds strings, most commonly the strings that represent the
1467 names associated with symbol table entries.
1468 If the file has a loadable
1469 segment that includes the symbol string table, the section's attributes
1473 Otherwise, the bit will be off.
1474 This section is of type
1478 This section holds a symbol table.
1479 If the file has a loadable segment
1480 that includes the symbol table, the section's attributes will include
1484 Otherwise, the bit will be off.
1485 This section is of type
1489 This section holds the
1491 or executable instructions, of a program.
1492 This section is of type
1494 The attributes used are
1500 String table sections hold null-terminated character sequences, commonly
1502 The object file uses these strings to represent symbol
1504 One references a string as an index into the string
1506 The first byte, which is index zero, is defined to hold
1507 a null byte (\(aq\\0\(aq).
1508 Similarly, a string table's last byte is defined to
1509 hold a null byte, ensuring null termination for all strings.
1511 An object file's symbol table holds information needed to locate and
1512 relocate a program's symbolic definitions and references.
1514 index is a subscript into this array.
1520 Elf32_Addr st_value;
1522 unsigned char st_info;
1523 unsigned char st_other;
1533 unsigned char st_info;
1534 unsigned char st_other;
1536 Elf64_Addr st_value;
1542 The 32-bit and 64-bit versions have the same members, just in a different
1544 .\" .Bl -tag -width "st_value"
1547 This member holds an index into the object file's symbol string table,
1548 which holds character representations of the symbol names.
1550 is nonzero, it represents a string table index that gives the symbol
1552 Otherwise, the symbol table has no name.
1555 This member gives the value of the associated symbol.
1558 Many symbols have associated sizes.
1559 This member holds zero if the symbol
1560 has no size or an unknown size.
1563 This member specifies the symbol's type and binding attributes:
1564 .\" .Bl -tag -width "STT_SECTION"
1568 The symbol's type is not defined.
1571 The symbol is associated with a data object.
1574 The symbol is associated with a function or other executable code.
1577 The symbol is associated with a section.
1578 Symbol table entries of
1579 this type exist primarily for relocation and normally have
1584 By convention, the symbol's name gives the name of the source file
1585 associated with the object file.
1588 bindings, its section index is
1590 and it precedes the other
1592 symbols of the file, if it is present.
1595 This value up to and including
1597 is reserved for processor-specific semantics.
1600 This value down to and including
1602 is reserved for processor-specific semantics.
1604 .\" .Bl -tag -width "STB_GLOBAL"
1607 Local symbols are not visible outside the object file containing their
1609 Local symbols of the same name may exist in multiple files
1610 without interfering with each other.
1613 Global symbols are visible to all object files being combined.
1615 definition of a global symbol will satisfy another file's undefined
1616 reference to the same symbol.
1619 Weak symbols resemble global symbols, but their definitions have lower
1623 This value up to and including
1625 is reserved for processor-specific semantics.
1628 This value down to and including
1630 is reserved for processor-specific semantics.
1632 There are macros for packing and unpacking the binding and type fields:
1634 .BR ELF32_ST_BIND (info)
1636 .BR ELF64_ST_BIND (info)
1637 extract a binding from an
1641 .BR ELF32_ST_TYPE (info)
1643 .BR ELF64_ST_TYPE (info)
1645 extract a type from an
1649 .BR ELF32_ST_INFO "(bind, type)"
1651 .BR ELF64_ST_INFO "(bind, type)"
1653 convert a binding and a type into an
1660 This member defines the symbol visibility.
1661 .\" .Bl -tag -width "STV_PROTECTED"
1666 Default symbol visibility rules.
1669 Processor-specific hidden class.
1672 Symbol is unavailable in other modules.
1675 Not preemptible, not exported.
1678 There are macros for extracting the visibility type:
1680 .BR ELF32_ST_VISIBILITY (other)
1682 .BR ELF64_ST_VISIBILITY (other)
1687 Every symbol table entry is
1689 in relation to some section.
1690 This member holds the relevant section
1694 Relocation is the process of connecting symbolic references with
1695 symbolic definitions.
1696 Relocatable files must have information that
1697 describes how to modify their section contents, thus allowing executable
1698 and shared object files to hold the right information for a process's
1700 Relocation entries are these data.
1702 Relocation structures that do not need an addend:
1707 Elf32_Addr r_offset;
1716 Elf64_Addr r_offset;
1722 Relocation structures that need an addend:
1727 Elf32_Addr r_offset;
1737 Elf64_Addr r_offset;
1743 .\" .Bl -tag -width "r_offset"
1746 This member gives the location at which to apply the relocation action.
1747 For a relocatable file, the value is the byte offset from the beginning
1748 of the section to the storage unit affected by the relocation.
1750 executable file or shared object, the value is the virtual address of
1751 the storage unit affected by the relocation.
1754 This member gives both the symbol table index with respect to which the
1755 relocation must be made and the type of relocation to apply.
1757 types are processor-specific.
1758 When the text refers to a relocation
1759 entry's relocation type or symbol table index, it means the result of
1761 .BR ELF[32|64]_R_TYPE
1763 .BR ELF[32|64]_R_SYM ,
1764 respectively, to the entry's
1769 This member specifies a constant addend used to compute the value to be
1770 stored into the relocatable field.
1773 The .dynamic section contains a series of structures that hold relevant
1774 dynamic linking information.
1775 The d_tag member controls the interpretation
1787 extern Elf32_Dyn _DYNAMIC[];
1800 extern Elf64_Dyn _DYNAMIC[];
1803 .\" .Bl -tag -width "d_tag"
1806 This member may have any of the following values:
1807 .\" .Bl -tag -width "DT_SYMBOLIC"
1811 Marks end of dynamic section
1814 String table offset to name of a needed library
1817 Size in bytes of PLT relocs
1820 Address of PLT and/or GOT
1823 Address of symbol hash table
1826 Address of string table
1829 Address of symbol table
1832 Address of Rela relocs table
1835 Size in bytes of Rela table
1838 Size in bytes of a Rela table entry
1841 Size in bytes of string table
1844 Size in bytes of a symbol table entry
1847 Address of the initialization function
1850 Address of the termination function
1853 String table offset to name of shared object
1856 String table offset to library search path (deprecated)
1859 Alert linker to search this shared object before the executable for symbols
1862 Address of Rel relocs table
1865 Size in bytes of Rel table
1868 Size in bytes of a Rel table entry
1871 Type of reloc the PLT refers (Rela or Rel)
1874 Undefined use for debugging
1877 Absence of this indicates no relocs should apply to a nonwritable segment
1880 Address of reloc entries solely for the PLT
1883 Instruct dynamic linker to process all relocs before transferring control to
1887 String table offset to library search path
1890 Start of processor-specific semantics
1893 End of processor-specific semantics
1898 This member represents integer values with various interpretations.
1901 This member represents program virtual addresses.
1903 these addresses, the actual address should be computed based on the
1904 original file value and memory base address.
1905 Files do not contain
1906 relocation entries to fixup these addresses.
1909 Array containing all the dynamic structures in the .dynamic section.
1910 This is automatically populated by the linker.
1914 .\" ELF support first appeared in
1916 .\" although not all supported platforms use it as the native
1917 .\" binary file format.
1918 ELF first appeared in
1920 The ELF format is an adopted standard.
1929 Sun, BSD and AMD64 also support them; for further information,
1930 look under SEE ALSO.
1932 .\" The original version of this manual page was written by
1933 .\" .An Jeroen Ruigrok van der Werven
1934 .\" .Aq asmodai@FreeBSD.org
1935 .\" with inspiration from BSDi's
1948 .IR "Elf-64 Object File Format" .
1950 Santa Cruz Operation,
1951 .IR "System V Application Binary Interface" .
1953 UNIX System Laboratories,
1955 .IR "Executable and Linking Format (ELF)" .
1958 .IR "Linker and Libraries Guide" .
1961 .IR "System V Application Binary Interface AMD64 Architecture Processor Supplement" .