ILD

ARM relocation
作者:Herbert Yuan 邮箱:yuanjp@hust.edu.cn
发布时间:2018-1-6 站点:Inside Linux Development

Relocation Types

和每个重定向类型相关的计算成员:


A

加数


P

要重定向的位置,r_offset加上section的基地址。


S

符号的值


B

符号定义所在section的基地址。


ARM relocation types 0-16

TypeNameFieldComputation and meaning
0R_ARM_NONEAny

No relocation.

Encodes dependencies between sections.

1R_ARM_PC24ARM B/BLS-P+A
2R_ARM_ABS3232-bit wordS+A
3R_ARM_REL3232-bit wordS-P+A
4R_ARM_PC13ARM LDR r,[pc...]S-P+A
5R_ARM_ABS1616-bit half-wordS+A
6R_ARM_ABS12ARM LDR/STRS+A
7R_ARM_THM_ABSThumb LDR/STRS+A
8R_ARM_ABS88-bit byteS+A
9R_ARM_SBREL3232-bit wordS-B+A
10R_ARM_THM_PC22Thumb BL pairS-P+A
11R_ARM_THM_PC8
Thumb LDR r,[pc...]S-P+A
12R_ARM_AMP_VCALL9AMP VCALLObsolete - SA-1500 only.
13R_ARM_SWI24ARM SWIS+A
14R_ARM_THM_SWI8Thumb SWIS+A
15R_ARM_XPC25
ARM BLXS-P+A
16R_ARM_THM_XPC22Thumb BLX pairS-P+A

Note

R_ARM_NONE记录Section包含要重定向的地址,该地址依赖于符号定义所在的Section,该Section应当保留。


ARM relocation types 17-31, reserved to ARM Linux

TypeNameFieldComputation and meaning
17-19

Reserved to ARM LINUX
20R_ARM_COPY32 bit wordCopy symbol at dynamic link time
21R_ARM_GLOB_DAT32 bit wordCreate GOT entry
22R_ARM_JUMP_SLOT32 bit wordCreate PLT entry
23R_ARM_RELATIVE32 bit wordAdjust by program base
24R_ARM_GOTOFF32 bit wordOffset relative to start of GOT
25R_ARM_GOTPC32 bit wordInsert address of GOT
26R_ARM_GOT3232 bit wordEntry in GOT
27R_ARM_PLT32ARM BLEntry in PLT
28-31

Reserved to ARM LINUX


参考

  1. ARM ELF. 8 June, 2001.

Copyright © linuxdev.cc 2017-2024. Some Rights Reserved.