您的位置:首页 > 运维架构 > 网站架构

工具接口标准(TIS)可执行链接格式(ELF)规范-卷II-处理器特性(Intel架构) (Processor Specific (Intel Architecture))

2014-01-08 11:34 591 查看
本文是对Tool Interface Standard (TIS) Executable and Linking Format (ELF) Specification Version 1.2的翻译

工具接口标准(TIS)可执行链接格式(ELF)规范版本 1.2

翻译以中英对照方式,英语水品有限,如有翻译不当的地方,请谅解。

Introduction

介绍


This section describes the Intel Architecture specific information necessary to comply with the ELF object file format. This information is independent of operating system type. Further information on Intel platforms that is both Intel Architecture and operating
system dependent, is described in Book III.

此节描述遵守ELF对象文件格式必要的Inel架构特定信息。这些信息不依赖于操作系统类型。Intel平台上依赖于Intel架构和操作系统的更进一步的信息在卷III进行描述。

ELF Header

ELF头


Machine Information

机器信息


For file identification in e_ident, the Intel architecture requires the following values.

对于e_ident中文件识别,Intel架构需要以下值

Figure1-1. Intel Identification, e_ident

图1-1.Intel识别,e_ident

位置(Position)
值(Value)
e_ident[EI_CLASS]
ELFCLASS32
e_ident[EI_DATA]
ELFDATA2LSB
Processor identification resides in the ELF header's e_machine member and must have the value EM_386.

处理器识别位于ELF头中的成员e_machine,并且必须取值EM_386。

The ELF header's e_flags member holds bit flags associated with the file. The Intel architecture defines no flags; so this member contains zero.

ELF头的成员e_flags包含关联文件的位标志。Intel架构没有定义标志,所以此成员为0。

Relocation

重定位

Relocation Types

重定位类型


Relocation entries describe how to alter the following instruction and data fields (bit numbers appear in the lower box corners).

重定位入口描述如何转换以下指令和数据字段(位编号在图示方框的下角处)

Figure 1-2. Relocatable Fields

图1-2.重定位字段




word32

This specifies a 32-bit field occupying 4 bytes with arbitrary byte alignment.

These values use the same byte order as other word values in the Intel architecture.

此处指定了一个占据任意4字节对齐的32位字段。Intel架构下的所有字的值都使用相同的字节序。



Calculations below assume the actions are transforming a relocatable file into either an executable or a shared object file. Conceptually, the link editor merges one or more relocatable files to form the output. It first decides how to combine and locate the
input files, then updates the symbol values, and finally performs the relocation. Relocations applied to executable or shared object files are similar and accomplish the same result. Descriptions below use the following notation.

以下的计算假设转换一个重定位文件到一个可执行或者共享对象文件。概念上讲,链接编辑器合并一个或多个重定位文件来组成输出。它首先描述如何合并和定位输入文件,然后更新符号值,最后执行重定位。重定位应用到可执行或共享文件时是相似的并且达成相同的结果。后面的描述将使用以下的符号。

A

This means the addend used to compute the value of the relocatable field.

A表示这个加数被用来计算重定位字段的值。

P

This means the place (section offset or address) of the storage unit being relocated (computed using r_offset).

P表示存储位置单元的位置(分节偏移或地址)将被重定位(使用r_offset计算)。

S

This means the value of the symbol whose index resides in the relocation entry.

S表示索引位于重定位入口的符号值。

A relocation entry's r_offset value designates the offset or virtual address of the first byte of the affected storage unit. The relocation type specifies which bits to change and how to calculate their values. The Intel architecture uses only Elf32_Rel relocation
entries, the field to be relocated holds the addend. In all cases, the addend and the computed result use the same byte order.

重定位入口的r_offset值指定了被影响到的存储单元的偏移或虚拟地址。重定位类型指明了哪些位需要被改变及如何计算它们的值。Intel架构只使用Elf32_Rel重定位入口,被重定位的字段包含加数。在所有情况下,加数和计算结果使用相同的字节序。

Figure1-3. Relocation Types

图1-3.重定位类型

名字(Name)
值(Value)
字段(Field)
计算(Calculation)
R_386_NONE
0
none
none
R_386_32
1
word32
S+A
R_386_PC32
2
word32
S+A-P
NOTE. Relocation types 3 through 10 are reserved. (See Book III, Appendix A.)

注意:重定位类型3到10是被保留的。(看卷III,附录A)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐