- Added new notation for specifying relocation calculation
- Renamed:
- R_AMDGPU_32_LOW -> R_AMDGPU_ABS32_LO
- R_AMDGPU_32_HIGH -> R_AMDGPU_ABS32_HI
- R_AMDGPU_64 -> R_AMDGPU_ABS64
- Added:
- R_AMDGPU_REL32
- R_AMDGPU_REL64
- R_AMDGPU_ABS32
- Updated calculations for relative relocations
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Don't you need an actual R_AMDGPU_ABS32_LO too? If you need a _HI I would assume you need a _LO.
What I would expect is
FOO_ABS32: S + A : this has to be a 32 bit value
FOO_ABS32_LO: (S + A) & 0xffffffff: this writes the low 32 bit values of a 64 bit number.
I agree with Rafael here, can we keep R_AMDGPU_ABS32_LO and then just add R_AMDGPU_ABS32 as a separate relocation?
The old R_AMDGPU_ABS32_LO and the new R_AMDGPU_ABS32 are in fact the same thing. The & 0xffffffff is implicitly done because the result of the R_AMDGPU_ABS32 is a word32 not a word64. So putting in the & 0xffffffff is redundant. The other ABI documents (such as for the x86) do not put in the & 0xffffffff so it seemed best to follow their conventions. R_AMDGPU_ABS32_HI and R_AMDGPU_ABS32 both return 32 bits as they are both defined as word32. They differ in that R_AMDGPU_ABS32_HI takes the address and shifts it right by 32 bits which effectively means that the top 32 bits of the 64 bit address are returned, not the bottom 32 bits.