This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU/LLD] Add RELATIVE64 relocation record.
ClosedPublic

Authored by t-tye on Oct 13 2017, 4:32 PM.

Details

Summary

Add base relative relocation record that can be used for the following case (OpenCL example):

static __global int Var = 0; 
__global int* Ptr[] = {&Var};
...

In this case Var is a non premptable symbol and so its address can be used as the value of Ptr, with a base relative relocation that will add the delta between the ELF address and the actual load address. Such relocations do not require a symbol.

This also fixes LLD which was incorrectly generating a PCREL64 for this case.

Diff Detail

Repository
rL LLVM

Event Timeline

t-tye created this revision.Oct 13 2017, 4:32 PM
kzhuravl accepted this revision.Oct 13 2017, 5:34 PM

LGTM.

This revision is now accepted and ready to land.Oct 13 2017, 5:34 PM
ruiu accepted this revision.Oct 13 2017, 5:44 PM

LGTM

This revision was automatically updated to reflect the committed changes.