• X6_603614
  • 3.8MB
  • rar
  • 0
  • VIP专享
  • 0
  • 2022-05-05 05:17
报告1:ARM映像文件及执行机理 报告2:GNU开发ARM程序 报告3:BOOTLOADER
  • arm学习报告
  • ARM学习报告2.pdf
  • arm3.pdf
  • arm1.pdf
  • ELF.txt
Notes on the Flat-Text Transcription The content of this transcription differs from the content of the original document in the following ways. 1. Page breaks and pagination have been omitted. 2. As a result of the above, the page numbers have been left out of the table of contents, and the index has been omitted entirely. (Unlike a Postscript document, a text file can be searched.) 3. The contents of the title page and the footer text has been placed at the beginning. 4. The lines and boxes in the original figures and tables have been adapted. 5. Differing fonts have, of necessity, been elided. For the most part, the context is sufficient to understand the meaning. In a few places, however, the original document used italics to implicitly indicate that the text stood for a variable string. In these cases, I have used <angle brackets rel='nofollow' onclick='return false;'> around the text to indicate this. There are no occurrences of angle brackets in the original. 6. The original contains three errors which are not immediately obvious as such upon a casual reading, but which can be unambiguously identified as such and the proper contents determined. I have taken the liberty to correct these errors. Their locations are marked in the text by a {*}. Any other (seeming) errors I have let stand. Any other differences between the contents of this file and the original are my responsibility. Direct notices of such errors to Brian Raiter [Last edited Fri Jul 23 1999] ________________________________________________________________ EXECUTABLE AND LINKABLE FORMAT (ELF) Portable Formats Specification, Version 1.1 Tool Interface Standards (TIS) ________________________________________________________________ =========================== Contents =========================== PREFACE 1. OBJECT FILES Introduction ELF Header Sections String Table Symbol Table Relocation 2. PROGRAM LOADING AND DYNAMIC LINKING Introduction Program Header Program Loading Dynamic Linking 3. C LIBRARY C Library ________________________________________________________________ PREFACE ________________________________________________________________ ELF: Executable and Linking Format The Executable and Linking Format was originally developed and published by UNIX System Laboratories (USL) as part of the Application Binary Interface (ABI). The Tool Interface Standards committee (TIS) has selected the evolving ELF standard as a portable object file format that works on 32-bit Intel Architecture environments for a variety of operating systems. The ELF standard is intended to streamline software development by providing developers with a set of binary interface definitions that extend across multiple operating environments. This should reduce the number of different interface implementations, thereby reducing the need for recoding and recompiling code. About This Document This document is intended for developers who are creating object or executable files on various 32-bit environment operating systems. It is divided into the following three parts: * Part 1, ``Object Files'' describes the ELF object file format for the three main types of object files. * Part 2, ``Program Loading and Dynamic Linking'' describes the object file information and system actions that create running programs. * Part 3, ``C Library'' lists the symbols contained in libsys, the standard ANSI C and libc routines, and the global data symbols required by the libc routines. NOTE: References to X86 architecture have been changed to Intel Architecture. ________________________________________________________________ 1. OBJECT FILES ________________________________________________________________ ========================= Introduction ========================= Part 1 describes the iABI object file format, called ELF (Executable and Linking Format). There are three main types of object files. * A relocatable file holds code and data suitable for linking with other object files to create an executable or a shared object file. * An executable file holds a program suitable for execution; the file specifies how exec(BA_OS) creates a program's process image. * A shared object file holds code and data suitable for linking in two contexts. First, the link editor [see ld(SD_CMD)] may process it with other relocatable and shared object files to create another object file. Second, the dynamic linker combines it with an executable file and other shared objects to create a process image. Created by the assembler and link editor, object files are binary representations of programs intended to execute directly on a processor. Programs that require other abstract machines, such as shell scripts, are excluded. After the introductory material, Part 1 focuses on the file format and how it pertains to building programs. Part 2 also describes parts of the object file, concentrating on the information necessary to execute a program. File Format Object files participate in program linking (building a program) and program execution (running a program). For convenience and efficiency, the object file format provides parallel views of a file's contents, reflecting the differing needs of these activities. Figure 1-1 shows an object file's organization. + Figure 1-1: Object File Format Linking View Execution View ============ ============== ELF header ELF header Program header table (optional) Program header table Section 1 Segment 1 ... Segment 2 Section n ... Section header table Section header table (optional) An ELF header resides at the beginning and holds a ``road map'' describing the file's organization. Sections hold the bulk of object file information for the linking view: instructions, data, symbol table, relocation information, and so on. Descriptions of special sections appear later in Part 1. Part 2 discusses segments and the program execution view of the file. A program header table, if present, tells the system how to create a process image. Files used to build a process image (execute a program) must have a program header table; relocatable files do not need one. A section header table contains information describing the file's sections. Every section has an entry in the table; each entry gives information such as the section name, the section size, etc. Files used during linking must have a section header table; other object files may or may not have one. NOTE: Although the figure shows the program header table immediately after the ELF header, and the section header table following the sections, actual files may differ. Moreover, sections and segments have no specified order. Only the ELF header has a fixed position in the file. Data Representation As described here, the object file format supports various processors with 8-bit bytes and 32-bit architectures. Nevertheless, it is intended to be extensible to larger (or smaller) architectures. Object files therefore represent some control data with a machine-independent format, making it possible to identify object files and interpret their contents in a common way. Remaining data in an object file use the encoding of the target processor, regardless of the machine on which the file was created. + Figure 1-2: 32-Bit Data Types Name Size Alignment Purpose ==== ==== ========= ======= Elf32_Addr 4 4 Unsigned program address Elf32_Half 2 2 Unsigned medium