This is an archive of the discontinued LLVM Phabricator instance.

[docs] Update AMDGPU relocation information
ClosedPublic

Authored by kzhuravl on Jun 9 2016, 7:03 PM.

Details

Summary
  • 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

Diff Detail

Repository
rL LLVM

Event Timeline

kzhuravl updated this revision to Diff 60296.Jun 9 2016, 7:03 PM
kzhuravl retitled this revision from to [docs] Update AMDGPU relocation information.
kzhuravl updated this object.
kzhuravl added a subscriber: llvm-commits.
kzhuravl updated this revision to Diff 60299.Jun 9 2016, 7:06 PM

Add missing "="

rafael edited edge metadata.Jun 9 2016, 7:31 PM

This drop R_AMDGPU_32. Don't you need it for dwarf?

kzhuravl updated this revision to Diff 60378.Jun 10 2016, 11:28 AM
kzhuravl updated this object.
kzhuravl edited edge metadata.

We are intending to use R_AMDGPU_ABS32_LO for dwarf

kzhuravl updated this revision to Diff 60427.Jun 10 2016, 4:53 PM
kzhuravl updated this object.

Try to eliminate confusion: renamed R_AMDGPU_ABS32_LO to R_AMDGPU_ABS32

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?

tony-tye edited edge metadata.Jun 10 2016, 10:42 PM
tony-tye added a subscriber: tony-tye.

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.

kzhuravl updated this revision to Diff 60617.Jun 13 2016, 3:05 PM
kzhuravl updated this object.
kzhuravl edited edge metadata.

Added back R_AMDGPU_ABS32_LO, also added R_AMDGPU_ABS32

This revision was automatically updated to reflect the committed changes.