Linux Kernel Architecture

(Jacob Rumans) #1
Mauerer runapp05.tex V1 - 09/04/2008 6:13pm Page 1265

Appendix E: The ELF Binary Format


Real programs, such as theemacseditor, need a significantly larger number of dynamic libraries
in order to run:
wolfgang@meitner>readelf — dynamic /usr/bin/emacs
Dynamic segment at offset 0x1ea6ec contains 36 entries:
Tag Type Name/Value
0x00000001 (NEEDED) Shared library: [libXaw3d.so.7]
0x00000001 (NEEDED) Shared library: [libXmu.so.6]
0x00000001 (NEEDED) Shared library: [libXt.so.6]
0x00000001 (NEEDED) Shared library: [libSM.so.6]
0x00000001 (NEEDED) Shared library: [libICE.so.6]
0x00000001 (NEEDED) Shared library: [libXext.so.6]
0x00000001 (NEEDED) Shared library: [libtiff.so.3]
0x00000001 (NEEDED) Shared library: [libjpeg.so.62]
0x00000001 (NEEDED) Shared library: [libpng.so.2]
0x00000001 (NEEDED) Shared library: [libz.so.1]
0x00000001 (NEEDED) Shared library: [libm.so.6]
0x00000001 (NEEDED) Shared library: [libungif.so.4]
0x00000001 (NEEDED) Shared library: [libXpm.so.4]
0x00000001 (NEEDED) Shared library: [libX11.so.6]
0x00000001 (NEEDED) Shared library: [libncurses.so.5]
0x00000001 (NEEDED) Shared library: [libc.so.6]
0x0000000f (RPATH) Library rpath: [/usr/X11R6/lib]
...
❑ DT_STRTABholds the position of the string table in which the names of all dynamic libraries and
symbols required for the dynamic section reside.
❑ DT_SYMTABholds the position of the symbol table in which all information required for the
dynamic section reside.
❑ DT_INITandDT_FINIhold the addresses of the functions that are called to initialize and termi-
nate the program.

E.3 Summary


The binary code in executable files is arranged according to the ELF standard on most architectures
supported by Linux. This appendix has introduced you to the details of this layout. The format is impor-
tant not only for userland applications, but also for kernel modules. After providing you with a general
overview about ELF, this chapter discussed the in-kernel data structures that are required by the module
loader, and that provide a convenient way to examine various features of the ELF file format.
Free download pdf