SPRAB89A September 2011 – March 2014
Table 13-6 provides detailed information on how each relocation is encoded and performed. The table uses the following notations:
F | The relocatable field. The field is specified using the tuple [CS, O, FS], where CS is the container size, O is the starting offset from the LSB of the container to the LSB of the field, and FS is the size of the field. All values are in bits. |
R | The arithmetic result of the relocation operation |
EV | The encoded value to be stored back into the relocation field |
SE(x) | Sign-extended value of x. Sign-extension is conceptually performed to the width of the address space. |
ZE(x) | Zero-extended value of x. Zero-extension is conceptually performed to the width of the address space. |
For relocation types for which overflow checking is enabled, an overflow occurs if the encoded value (including its sign, if any) cannot be encoded into the relocatable field. That is:
Relocation Name | Signedness | Field [CS, O, FS] (F) | Addend (A) | Result (R) | Overflow Check | Encoded Value (EV) |
---|---|---|---|---|---|---|
R_C6000_NONE | none | [32, 0, 32] | none | none | no | none |
R_C6000_ABS32 | either | [32, 0, 32] | F | S + A | no | R |
R_C6000_ABS16 | either | [16, 0, 16] | SE(F) | S + A | yes | R |
R_C6000_ABS8 | either | [8, 0, 8] | SE(F) | S + A | yes | R |
R_C6000_PCR_S21 | signed | [32, 7, 21] | SE(F << 2) | S + A – P | yes | R >> 2 |
R_C6000_PCR_S12 | signed | [32, 16, 12] | SE(F << 2) | S + A – P | yes | R >> 2 |
R_C6000_PCR_S10 | signed | [32, 13, 10] | SE(F << 2) | S + A – P | yes | R >> 2 |
R_C6000_PCR_S7 | signed | [32, 16, 7] | SE(F << 2) | S + A – P | yes | R >> 2 |
R_C6000_ABS_S16 | signed | [32, 7, 16] | SE(F) | S + A | yes | R |
R_C6000_ABS_L16 | none | [32, 7, 16] | F | S + A | no | R |
R_C6000_ABS_H16 | none | [32, 7, 16] | r_addend | S + A | no | R >> 16 |
R_C6000_SBR_U15_B | unsigned | [32, 8, 15] | ZE(F) | S + A – B | yes | R |
R_C6000_SBR_U15_H | unsigned | [32, 8, 15] | ZE(F << 1) | S + A – B | yes | R >> 1 |
R_C6000_SBR_U15_W | unsigned | [32, 8, 15] | ZE(F << 2) | S + A – B | yes | R >> 2 |
R_C6000_SBR_S16 | signed | [32, 7, 16] | SE(F) | S + A – B | yes | R |
R_C6000_SBR_L16_B | unsigned | [32, 7, 16] | ZE(F) | S + A – B | no | R |
R_C6000_SBR_L16_H | unsigned | [32, 7, 16] | ZE(F << 1) | S + A – B | no | R >> 1 |
R_C6000_SBR_L16_W | unsigned | [32, 7, 16] | ZE(F << 2) | S + A – B | no | R >> 2 |
R_C6000_SBR_H16_B | unsigned | [32, 7, 16] | r_addend | S + A – B | no | R >> 16 |
R_C6000_SBR_H16_H | unsigned | [32, 7, 16] | r_addend | S + A – B | no | R >> 17 |
R_C6000_SBR_H16_W | unsigned | [32, 7, 16] | r_addend | S + A – B | no | R >> 18 |
R_C6000_SBR_GOT_U15_W | unsigned | [32, 8, 15] | ZE(F << 2) | GOT(s) + A – B | yes | R >> 2 |
R_C6000_SBR_GOT_L16_W | unsigned | [32, 7, 16] | ZE(F << 2) | GOT(s) + A – B | no | R >> 2 |
R_C6000_SBR_GOT_H16_W | unsigned | [32, 7, 16] | r_addend | GOT(s) + A – B | no | R >> 18 |
R_C6000_DSBT_INDEX | unsigned | [32, 8, 15] | none | DSBT Index | yes | R |
R_C6000_PREL31 | none | [32, 0, 31] | SE(F << 1) | S + A - PC | no | R >> 1 |
R_C6000_COPY | none | [32, 0, 32] | none | F | no | F |
R_C6000_JUMP_SHOT | either | [32, 0, 32] | F | S + A | no | R |
R_C6000_EHTYPE | either | [32, 0, 32] | F | S + A - B | no | R |
R_C6000_PCR_H16 | signed | [32, 7, 16] | r_addend | S - FP(P - A) | no | R >> 16 |
R_C6000_PCR_L16 | none | [32, 7, 16] | r_addend | S - FP(P - A) | no | R |
R_C6000_TBR_U15_B | unsigned | [32,8,15] | ZE(F) | TBR(S) | Yes | R |
R_C6000_TBR_U15_H | unsigned | [32,8,15] | ZE(F<<1) | TBR(S) | Yes | R >> 1 |
R_C6000_TBR_U15_W | unsigned | [32,8,15] | ZE(F<<2) | TBR(S) | Yes | R >> 2 |
R_C6000_TBR_U15_D | unsigned | [32,8,15] | ZE(F<<3) | TBR(S) | Yes | R >> 3 |
R_C6000_TPR_S16 | Signed | [32,7,16] | SE(F) | TBR(S) | Yes | R |
R_C6000_TPR_U15_B | Unsigned | [32,8,15] | ZE(F) | TPR(S) | Yes | R |
R_C6000_TPR_U15_H | Unsigned | [32,8,15] | ZE(F<<1) | TPR(S) | Yes | R >> 1 |
R_C6000_TPR_U15_W | Unsigned | [32,8,15] | ZE(F<<2) | TPR(S) | Yes | R >> 2 |
R_C6000_TPR_U15_D | Unsigned | [32,8,15] | ZE(F<<3) | TPR(S) | Yes | R >> 3 |
R_C6000_TPR_U32_B | Unsigned | [32,0,326] | ZE(F) | TPR(S) | No | R |
R_C6000_TPR_U32_H | Unsigned | [32,0,326] | ZE(F<<1) | TPR(S) | No | R >> 1 |
R_C6000_TPR_U32_W | Unsigned | [32,0,326] | ZE(F<<2) | TPR(S) | No | R >> 2 |
R_C6000_TPR_U32_D | Unsigned | [32,0,326] | ZE(F<<3) | TPR(S) | No | R >> 3 |
R_C6000_SBR_GOT_U15_W_TLSMOD | Unsigned | [32,8,15] | ZE(F<<2) | GOT(TLSMOD(S)) + A - B | Yes | R >> 2 |
R_C6000_SBR_GOT_U15_W_TBR | Unsigned | [32,8,15] | ZE(F<<2) | GOT(TBR(S)) + A - B | Yes | R >> 2 |
R_C6000_SBR_GOT_U15_W_TPR_B | Unsigned | [32,8,15] | ZE(F<<2) | GOT(TBR(S)) + A - B | Yes | R >> 2 |
R_C6000_SBR_GOT_U15_W_TPR_H | Unsigned | [32,8,15] | ZE(F<<2) | GOT(TBR(S)) + A - B | Yes | R >> 2 |
R_C6000_SBR_GOT_U15_W_TPR_W | Unsigned | [32,8,15] | ZE(F<<2) | GOT(TBR(S)) + A - B | Yes | R >> 2 |
R_C6000_SBR_GOT_U15_W_TPR_D | Unsigned | [32,8,15] | ZE(F<<2) | GOT(TBR(S)) + A - B | Yes | R >> 2 |
R_C6000_SBR_GOT_L16_W_TLSMOD | Unsigned | [32,7,16] | ZE(F<<2) | GOT(TLSMOD(S)) + A - B | No | R >> 2 |
R_C6000_SBR_GOT_L16_W_TBR | Unsigned | [32,7,16] | ZE(F<<2) | GOT(TBR(S)) + A - B | No | R >> 2 |
R_C6000_SBR_GOT_L16_W_TPR_B | Unsigned | [32,7,16] | ZE(F<<2) | GOT(TBR(S)) + A - B | No | R >> 2 |
R_C6000_SBR_GOT_L16_W_TPR_H | Unsigned | [32,7,16] | ZE(F<<2) | GOT(TBR(S)) + A - B | No | R >> 2 |
R_C6000_SBR_GOT_L16_W_TPR_W | Unsigned | [32,7,16] | ZE(F<<2) | GOT(TBR(S)) + A - B | No | R >> 2 |
R_C6000_SBR_GOT_L16_W_TPR_D | Unsigned | [32,7,16] | ZE(F<<2) | GOT(TBR(S)) + A - B | No | R >> 2 |
R_C6000_SBR_GOT_H16_W_TLSMOD | Unsigned | [32,7,16] | ZE(F<<2) | GOT(TLSMOD(S)) + A - B | No | R >> 18 |
R_C6000_SBR_GOT_H16_W_TBR | Unsigned | [32,7,16] | ZE(F<<2) | GOT(TBR(S)) + A - B | No | R >> 18 |
R_C6000_SBR_GOT_H16_W_TPR_B | Unsigned | [32,7,16] | ZE(F<<2) | GOT(TBR(S)) + A - B | No | R >> 18 |
R_C6000_SBR_GOT_H16_W_TPR_H | Unsigned | [32,7,16] | ZE(F<<2) | GOT(TBR(S)) + A - B | No | R >> 18 |
R_C6000_SBR_GOT_H16_W_TPR_W | Unsigned | [32,7,16] | ZE(F<<2) | GOT(TBR(S)) + A - B | No | R >> 18 |
R_C6000_SBR_GOT_H16_W_TPR_D | Unsigned | [32,7,16] | ZE(F<<2) | GOT(TBR(S)) + A - B | No | R >> 18 |
R_C6000_TLSMOD | Unsigned | [32,0,32] | F | TLSMOD(S) | No | R |
R_C6000_TBR_U32 | Unsigned | [32,0,32] | F | TBR(S) | No | R |
R_C6000_FPHEAD | none | none | none | none | no | none |
R_C6000_NOCMP | none | none | none | none | no | none |