[ELF] Implement General Dynamic style TLSDESC for x86-64

This handles two initial relocation types R_X86_64_GOTPC32_TLSDESC and
R_X86_64_TLSDESC_CALL, as well as the GD->LE and GD->IE relaxations.

Reviewed By: ruiu

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

llvm-svn: 361911
This commit is contained in:
Fangrui Song
2019-05-29 02:03:56 +00:00
parent 656afe370d
commit 719322411c
6 changed files with 170 additions and 39 deletions

View File

@@ -755,6 +755,8 @@ static uint64_t getRelocTargetVA(const InputFile *File, RelType Type, int64_t A,
return Sym.getSize() + A;
case R_TLSDESC:
return In.Got->getGlobalDynAddr(Sym) + A;
case R_TLSDESC_PC:
return In.Got->getGlobalDynAddr(Sym) + A - P;
case R_AARCH64_TLSDESC_PAGE:
return getAArch64Page(In.Got->getGlobalDynAddr(Sym) + A) -
getAArch64Page(P);