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.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp
index 3ea7cebeaac..b536defca55 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -37,6 +37,8 @@ static typename ELFT::uint getSymVA(const SymbolBody &Body,
switch (Body.kind()) {
case SymbolBody::DefinedSyntheticKind: {
auto &D = cast<DefinedSynthetic<ELFT>>(Body);
+ if (D.Value == DefinedSynthetic<ELFT>::SectionEnd)
+ return D.Section.getVA() + D.Section.getSize();
return D.Section.getVA() + D.Value;
}
case SymbolBody::DefinedRegularKind: {
@@ -133,6 +135,13 @@ template <class ELFT> typename ELFT::uint SymbolBody::getPltVA() const {
PltIndex * Target->PltEntrySize;
}
+template <class ELFT> typename ELFT::uint SymbolBody::getThunkVA() const {
+ auto *D = cast<DefinedRegular<ELFT>>(this);
+ auto *S = cast<InputSection<ELFT>>(D->Section);
+ return S->OutSec->getVA() + S->OutSecOff + S->getThunkOff() +
+ ThunkIndex * Target->ThunkSize;
+}
+
template <class ELFT> typename ELFT::uint SymbolBody::getSize() const {
if (auto *B = dyn_cast<DefinedElf<ELFT>>(this))
return B->Sym.st_size;
@@ -298,6 +307,11 @@ template uint32_t SymbolBody::template getSize<ELF32BE>() const;
template uint64_t SymbolBody::template getSize<ELF64LE>() const;
template uint64_t SymbolBody::template getSize<ELF64BE>() const;
+template uint32_t SymbolBody::template getThunkVA<ELF32LE>() const;
+template uint32_t SymbolBody::template getThunkVA<ELF32BE>() const;
+template uint64_t SymbolBody::template getThunkVA<ELF64LE>() const;
+template uint64_t SymbolBody::template getThunkVA<ELF64BE>() const;
+
template int SymbolBody::compare<ELF32LE>(SymbolBody *Other);
template int SymbolBody::compare<ELF32BE>(SymbolBody *Other);
template int SymbolBody::compare<ELF64LE>(SymbolBody *Other);
OpenPOWER on IntegriCloud