Skip to content

Commit a1b3b78

Browse files
authored
[AMDGPU] Clarify description of _HI relocation types (#73663)
Clarify how the addend is used in _HI relocation types like R_AMDGPU_ABS32_HI based on the current behaviour of the Mesa and AMDPAL ELF loaders. This affects Mesa and AMDPAL because they use REL relocation records, so the addend for these types is the 32-bit literal value from the instruction being relocated. AMDHSA is not affected because it uses RELA relocation records which have a 64-bit addend.
1 parent 202dda8 commit a1b3b78

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

llvm/docs/AMDGPUUsage.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2050,7 +2050,12 @@ relocatable fields are:
20502050
Following notations are used for specifying relocation calculations:
20512051

20522052
**A**
2053-
Represents the addend used to compute the value of the relocatable field.
2053+
Represents the addend used to compute the value of the relocatable field. If
2054+
the addend field is smaller than 64 bits then it is zero-extended to 64 bits
2055+
for use in the calculations below. (In practice this only affects ``_HI``
2056+
relocation types on Mesa/AMDPAL, where the addend comes from the 32-bit field
2057+
but the result of the calculation depends on the high part of the full 64-bit
2058+
address.)
20542059

20552060
**G**
20562061
Represents the offset into the global offset table at which the relocation

0 commit comments

Comments
 (0)