summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Symbols.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/Symbols.cpp')
-rw-r--r--lld/ELF/Symbols.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp
index bd6f6b467d7..125e6c7a7b6 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -44,10 +44,12 @@ typename ELFFile<ELFT>::uintX_t SymbolBody::getVA() const {
return D->Sym.st_value;
assert(SC->Live);
- // Symbol offsets for AMDGPU need to be the offset in bytes of the symbol
- // from the beginning of the section.
+ // Symbol offsets for AMDGPU are the offsets in bytes of the symbols
+ // from the beginning of the section. Note that this part of AMDGPU's
+ // ELF spec is odd and not in line with the standard ELF.
if (Config->EMachine == EM_AMDGPU)
return SC->getOffset(D->Sym);
+
if (D->Sym.getType() == STT_TLS)
return SC->OutSec->getVA() + SC->getOffset(D->Sym) -
Out<ELFT>::TlsPhdr->p_vaddr;
OpenPOWER on IntegriCloud