Add base relative relocation record that can be used for the following case (OpenCL...
authorTony Tye <Tony.Tye@amd.com>
Mon, 16 Oct 2017 20:44:29 +0000 (20:44 +0000)
committerTony Tye <Tony.Tye@amd.com>
Mon, 16 Oct 2017 20:44:29 +0000 (20:44 +0000)
commitd288430c3e8597c5eb74ab6fe9ee6f4ef75b1723
tree79707b24ef4e29d1dade7244035019508ae5218b
parent038f4ea367c577052d9332ff01d2794bdd9cfb6a
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.

Differential Revision: https://reviews.llvm.org/D38909

llvm-svn: 315935
llvm/docs/AMDGPUUsage.rst
llvm/include/llvm/BinaryFormat/ELFRelocs/AMDGPU.def
llvm/test/Object/AMDGPU/elf64-relocs.yaml