This is an archive of the discontinued LLVM Phabricator instance.

docs: Add AMDGPU relocation information
ClosedPublic

Authored by tstellarAMD on Jun 3 2016, 2:51 AM.

Details

Summary

This documents the various relocation types that are supported by the
Radeon Open Compute (ROC) runtime (which is essentially the dynamic
linker for AMDGPU).

Only R_AMDGPU_32 is not currently supported by the ROC runtime, but
it will usually be resolved at link time by lld.

Patch by: Konstantin Zhuravlyov

Diff Detail

Repository
rL LLVM

Event Timeline

tstellarAMD retitled this revision from to docs: Add AMDGPU relocation information.
tstellarAMD updated this object.
tstellarAMD added subscribers: llvm-commits, arsenm.
rafael edited edge metadata.Jun 3 2016, 8:55 AM
rafael added a subscriber: rafael.

+
+ ==================== ===== ========== ============================
+ Relocation type Value Field Calculation
+ ==================== ===== ========== ============================
+ `R_AMDGPU_NONE 0 none none`
+ `R_AMDGPU_32_LOW 1 word32` (S + A) & 0xFFFFFFFF
+ `R_AMDGPU_32_HIGH 2 word32` ((S + A) >> 32) & 0xFFFFFFFF
+ `R_AMDGPU_64 3 word64` (S + A) & 0xFFFFFFFFFFFFFFFF

You can write R_AMDGPU-64 as just S + A.

+ `R_AMDGPU_32 4 word32` S + A
+ ==================== ===== ========== ============================

Please document which ones can be handled by the dynamic linker and
which ones must be statically resolved.

LGTM with that.

Cheers,
Rafael

This revision was automatically updated to reflect the committed changes.