SPRAC71B February 2019 – October 2023
Table 11-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. The notation [x,y]+[z,w] indicates that relocation occupies discontiguous bit ranges, which should be concatenated to form the field. When "F" is used in the addend column, it indicates that the field is already of the exact size of the address space. |
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. |
r_addend | The addend must be stored in a RELA field, and may not be stored in the relocation container. |
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 | Container Size (CS) | Field [O, FS] (F) | Addend (A) | Result (R) | Overflow Check | Encoded Value (EV) |
R_C28X_NONE | None | 32 | [0,32] | None | None | No | None |
R_C28X_ABS32 | Either | 32 | [0,32] | F | S + A | No | R |
R_C28X_ABS16 | Either | 16 | [0,16] | SE(F) | S + A | No | R |
R_C28X_ABS8 | Either | 8 | [0,8] | SE(F) | S + A | Yes | R |
R_C28X_PCR16 | Signed | 16 | [0,16] | SE(F) | S + A - P | No | R |
R_C28X_ABS_HI16 | None | 16 | [0,16] | r_addend | S + A | No | R >> 16 |
R_C28X_PREL31 | Signed | 32 | [0,31] | SE(F) | S + A - P | No | R >> 1 |