diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2016-12-19 11:58:01 +0000 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2016-12-19 11:58:01 +0000 |
commit | 86513f06be320217c8b1c2a10ce50db23dc84e8a (patch) | |
tree | 39fd7325355ec444424e5fbf7b3a5e19af8e459c /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | 1437f6d710ecf2c7a6aa19858e57a93ee0685338 (diff) | |
download | llvm-86513f06be320217c8b1c2a10ce50db23dc84e8a.zip llvm-86513f06be320217c8b1c2a10ce50db23dc84e8a.tar.gz llvm-86513f06be320217c8b1c2a10ce50db23dc84e8a.tar.bz2 |
ELF/AArch64: Fix dynamic relocation against local symbol in shared objects
AArch64 TLSDESC for local symbol in shared objects are implemented in a
arch specific manner where the TLSDESC dynamic relocation addend is the
symbol VM inside the TLS block. For instance, with a shared library
created from the code:
--
static __thread int32_t x1;
static __thread int64_t x2;
int32_t foo1 (int32_t x)
{
x1 += x;
return x;
}
int64_t foo2 (int64_t x)
{
x2 += x;
return x;
}
--
The dynamic relocation should be create as:
Relocations [
Section (N) .rela.dyn {
<Address1> R_AARCH64_TLSDESC - 0x0
<Address2> R_AARCH64_TLSDESC - 0x8
}
]
Where 0x0 addend in first dynamic relocation is the address of 'x1'
in TLS block and '0x8' is the address of 'x2'.
Checked against test-suite on aarch64-linux-gnu.
llvm-svn: 290099
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
0 files changed, 0 insertions, 0 deletions