blob: 5ce57386818a88fa0358b853d18d7a880677137b [file] [log] [blame]
Michael J. Spencer84487f12015-07-24 21:03:07 +00001//===- Symbols.cpp --------------------------------------------------------===//
2//
3// The LLVM Linker
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "Symbols.h"
Rafael Espindola49a2ca62015-08-06 15:33:19 +000011#include "Error.h"
Michael J. Spencercdae0a42015-07-28 22:58:25 +000012#include "InputFiles.h"
Rui Ueyamab5a69702016-02-01 21:00:35 +000013#include "InputSection.h"
14#include "OutputSections.h"
15#include "Target.h"
Michael J. Spencer84487f12015-07-24 21:03:07 +000016
Michael J. Spencer1b348a62015-09-04 22:28:10 +000017#include "llvm/ADT/STLExtras.h"
Rui Ueyamaa4a628f2016-01-13 18:55:39 +000018#include "llvm/Config/config.h"
19
20#ifdef HAVE_CXXABI_H
21#include <cxxabi.h>
22#endif
Michael J. Spencer1b348a62015-09-04 22:28:10 +000023
24using namespace llvm;
Michael J. Spencer84487f12015-07-24 21:03:07 +000025using namespace llvm::object;
Rafael Espindola78471f02015-09-01 23:12:52 +000026using namespace llvm::ELF;
Michael J. Spencer84487f12015-07-24 21:03:07 +000027
28using namespace lld;
Rafael Espindolae0df00b2016-02-28 00:25:54 +000029using namespace lld::elf;
Michael J. Spencer84487f12015-07-24 21:03:07 +000030
Rui Ueyamab5a69702016-02-01 21:00:35 +000031template <class ELFT>
Rui Ueyama9328b2c2016-03-14 23:16:09 +000032static typename ELFT::uint getSymVA(const SymbolBody &Body,
33 typename ELFT::uint &Addend) {
Rui Ueyama9328b2c2016-03-14 23:16:09 +000034 typedef typename ELFT::uint uintX_t;
Rafael Espindola87d9f102016-03-11 12:19:05 +000035
36 switch (Body.kind()) {
37 case SymbolBody::DefinedSyntheticKind: {
38 auto &D = cast<DefinedSynthetic<ELFT>>(Body);
Simon Atanasyan13f6da12016-03-31 21:26:23 +000039 if (D.Value == DefinedSynthetic<ELFT>::SectionEnd)
40 return D.Section.getVA() + D.Section.getSize();
Rafael Espindola87d9f102016-03-11 12:19:05 +000041 return D.Section.getVA() + D.Value;
Rui Ueyamab5a69702016-02-01 21:00:35 +000042 }
Rafael Espindola87d9f102016-03-11 12:19:05 +000043 case SymbolBody::DefinedRegularKind: {
44 auto &D = cast<DefinedRegular<ELFT>>(Body);
45 InputSectionBase<ELFT> *SC = D.Section;
Rui Ueyamab5a69702016-02-01 21:00:35 +000046
Rafael Espindolaccfe3cb2016-04-04 14:04:16 +000047 // According to the ELF spec reference to a local symbol from outside
48 // the group are not allowed. Unfortunately .eh_frame breaks that rule
49 // and must be treated specially. For now we just replace the symbol with
50 // 0.
51 if (SC == &InputSection<ELFT>::Discarded)
52 return 0;
53
Rui Ueyamab5a69702016-02-01 21:00:35 +000054 // This is an absolute symbol.
55 if (!SC)
Rafael Espindolaccfe3cb2016-04-04 14:04:16 +000056 return D.Value;
Rui Ueyamab5a69702016-02-01 21:00:35 +000057
Rafael Espindolaccfe3cb2016-04-04 14:04:16 +000058 uintX_t Offset = D.Value;
59 if (D.isSection()) {
Rafael Espindola1f5b70f2016-03-11 14:21:37 +000060 Offset += Addend;
61 Addend = 0;
62 }
63 uintX_t VA = SC->OutSec->getVA() + SC->getOffset(Offset);
Rafael Espindolaccfe3cb2016-04-04 14:04:16 +000064 if (D.isTls())
Rafael Espindola1f5b70f2016-03-11 14:21:37 +000065 return VA - Out<ELFT>::TlsPhdr->p_vaddr;
66 return VA;
Rui Ueyamab5a69702016-02-01 21:00:35 +000067 }
Rafael Espindola87d9f102016-03-11 12:19:05 +000068 case SymbolBody::DefinedCommonKind:
69 return Out<ELFT>::Bss->getVA() + cast<DefinedCommon>(Body).OffsetInBss;
70 case SymbolBody::SharedKind: {
71 auto &SS = cast<SharedSymbol<ELFT>>(Body);
72 if (!SS.NeedsCopyOrPltAddr)
Rafael Espindolaa0a65f92016-02-09 15:11:01 +000073 return 0;
Rafael Espindolaccfe3cb2016-04-04 14:04:16 +000074 if (SS.isFunc())
Rafael Espindola87d9f102016-03-11 12:19:05 +000075 return Body.getPltVA<ELFT>();
Rui Ueyama2df72892016-03-13 20:54:38 +000076 return Out<ELFT>::Bss->getVA() + SS.OffsetInBss;
Rui Ueyamab5a69702016-02-01 21:00:35 +000077 }
Rafael Espindola87d9f102016-03-11 12:19:05 +000078 case SymbolBody::UndefinedElfKind:
Rafael Espindolaf4765732016-04-06 13:22:41 +000079 case SymbolBody::UndefinedBitcodeKind:
Rui Ueyamab5a69702016-02-01 21:00:35 +000080 return 0;
Rafael Espindola87d9f102016-03-11 12:19:05 +000081 case SymbolBody::LazyKind:
George Rimar777f9632016-03-12 08:31:34 +000082 assert(Body.isUsedInRegularObj() && "lazy symbol reached writer");
Rui Ueyamab5a69702016-02-01 21:00:35 +000083 return 0;
Rafael Espindola87d9f102016-03-11 12:19:05 +000084 case SymbolBody::DefinedBitcodeKind:
Davide Italianof6523ae2016-03-29 02:20:10 +000085 llvm_unreachable("should have been replaced");
Rui Ueyamab5a69702016-02-01 21:00:35 +000086 }
George Rimar777f9632016-03-12 08:31:34 +000087 llvm_unreachable("invalid symbol kind");
Rui Ueyamab5a69702016-02-01 21:00:35 +000088}
89
Rui Ueyamab5792b22016-04-04 19:09:08 +000090SymbolBody::SymbolBody(Kind K, uint32_t NameOffset, uint8_t StOther,
91 uint8_t Type)
Rafael Espindola5e345682016-04-06 14:31:03 +000092 : SymbolKind(K), Type(Type), Binding(STB_LOCAL), StOther(StOther),
93 NameOffset(NameOffset) {
Rafael Espindolaf4765732016-04-06 13:22:41 +000094 init();
95}
96
97SymbolBody::SymbolBody(Kind K, StringRef Name, uint8_t Binding, uint8_t StOther,
98 uint8_t Type)
Rafael Espindola5e345682016-04-06 14:31:03 +000099 : SymbolKind(K), Type(Type), Binding(Binding), StOther(StOther),
Rafael Espindolaf4765732016-04-06 13:22:41 +0000100 Name({Name.data(), Name.size()}) {
101 assert(!isLocal());
102 init();
103}
104
105void SymbolBody::init() {
106 Kind K = kind();
107 IsUsedInRegularObj = K == DefinedRegularKind || K == DefinedCommonKind ||
108 K == DefinedSyntheticKind || K == UndefinedElfKind;
Rafael Espindola5e345682016-04-06 14:31:03 +0000109 CanKeepUndefined = false;
110 MustBeInDynSym = false;
111 NeedsCopyOrPltAddr = false;
Rafael Espindolaccfe3cb2016-04-04 14:04:16 +0000112}
113
Rui Ueyamac4466602016-03-13 19:48:18 +0000114// Returns true if a symbol can be replaced at load-time by a symbol
115// with the same name defined in other ELF executable or DSO.
116bool SymbolBody::isPreemptible() const {
117 if (isLocal())
118 return false;
119
120 if (isShared())
121 return true;
122
123 if (isUndefined()) {
124 if (!isWeak())
125 return true;
126
127 // Ideally the static linker should see a definition for every symbol, but
128 // shared object are normally allowed to have undefined references that the
129 // static linker never sees a definition for.
130 if (Config->Shared)
131 return true;
132
133 // Otherwise, just resolve to 0.
134 return false;
135 }
136
137 if (!Config->Shared)
138 return false;
139 if (getVisibility() != STV_DEFAULT)
140 return false;
Rafael Espindolaccfe3cb2016-04-04 14:04:16 +0000141 if (Config->Bsymbolic || (Config->BsymbolicFunctions && isFunc()))
Rui Ueyamac4466602016-03-13 19:48:18 +0000142 return false;
143 return true;
144}
145
Rui Ueyamab5a69702016-02-01 21:00:35 +0000146template <class ELFT>
Rui Ueyama9328b2c2016-03-14 23:16:09 +0000147typename ELFT::uint SymbolBody::getVA(typename ELFT::uint Addend) const {
Rafael Espindola8381c562016-03-17 23:36:19 +0000148 typename ELFT::uint OutVA = getSymVA<ELFT>(*this, Addend);
149 return OutVA + Addend;
Rafael Espindola87d9f102016-03-11 12:19:05 +0000150}
151
Rui Ueyama9328b2c2016-03-14 23:16:09 +0000152template <class ELFT> typename ELFT::uint SymbolBody::getGotVA() const {
Rafael Espindola74031ba2016-04-07 15:20:56 +0000153 return Out<ELFT>::Got->getVA() + getGotOffset<ELFT>();
154}
155
156template <class ELFT> typename ELFT::uint SymbolBody::getGotOffset() const {
157 return (Out<ELFT>::Got->getMipsLocalEntriesNum() + GotIndex) *
158 sizeof(typename ELFT::uint);
Rui Ueyamab5a69702016-02-01 21:00:35 +0000159}
160
Rui Ueyama9328b2c2016-03-14 23:16:09 +0000161template <class ELFT> typename ELFT::uint SymbolBody::getGotPltVA() const {
Rafael Espindola74031ba2016-04-07 15:20:56 +0000162 return Out<ELFT>::GotPlt->getVA() + getGotPltOffset<ELFT>();
163}
164
165template <class ELFT> typename ELFT::uint SymbolBody::getGotPltOffset() const {
166 return GotPltIndex * sizeof(typename ELFT::uint);
Rui Ueyamab5a69702016-02-01 21:00:35 +0000167}
168
Rui Ueyama9328b2c2016-03-14 23:16:09 +0000169template <class ELFT> typename ELFT::uint SymbolBody::getPltVA() const {
Rui Ueyamab5a69702016-02-01 21:00:35 +0000170 return Out<ELFT>::Plt->getVA() + Target->PltZeroSize +
171 PltIndex * Target->PltEntrySize;
172}
173
Simon Atanasyan13f6da12016-03-31 21:26:23 +0000174template <class ELFT> typename ELFT::uint SymbolBody::getThunkVA() const {
175 auto *D = cast<DefinedRegular<ELFT>>(this);
176 auto *S = cast<InputSection<ELFT>>(D->Section);
177 return S->OutSec->getVA() + S->OutSecOff + S->getThunkOff() +
178 ThunkIndex * Target->ThunkSize;
179}
180
Rui Ueyama9328b2c2016-03-14 23:16:09 +0000181template <class ELFT> typename ELFT::uint SymbolBody::getSize() const {
Rafael Espindolaccfe3cb2016-04-04 14:04:16 +0000182 if (const auto *C = dyn_cast<DefinedCommon>(this))
183 return C->Size;
184 if (const auto *DR = dyn_cast<DefinedRegular<ELFT>>(this))
185 return DR->Size;
186 if (const auto *S = dyn_cast<SharedSymbol<ELFT>>(this))
187 return S->Sym.st_size;
188 if (const auto *U = dyn_cast<UndefinedElf<ELFT>>(this))
189 return U->Size;
Rui Ueyama512c61d2016-02-03 00:12:24 +0000190 return 0;
191}
192
Rafael Espindola78471f02015-09-01 23:12:52 +0000193static uint8_t getMinVisibility(uint8_t VA, uint8_t VB) {
194 if (VA == STV_DEFAULT)
195 return VB;
196 if (VB == STV_DEFAULT)
197 return VA;
198 return std::min(VA, VB);
199}
200
George Rimar3498c7f2016-03-10 18:49:24 +0000201static int compareCommons(DefinedCommon *A, DefinedCommon *B) {
George Rimar34358002016-03-14 09:19:30 +0000202 if (Config->WarnCommon)
203 warning("multiple common of " + A->getName());
Rui Ueyama17d69832016-03-10 18:58:53 +0000204 A->Alignment = B->Alignment = std::max(A->Alignment, B->Alignment);
Davide Italiano901de032016-03-21 22:44:24 +0000205 return A->Size < B->Size ? -1 : 1;
George Rimar3498c7f2016-03-10 18:49:24 +0000206}
207
Michael J. Spencer84487f12015-07-24 21:03:07 +0000208// Returns 1, 0 or -1 if this symbol should take precedence
209// over the Other, tie or lose, respectively.
Peter Collingbourned0856a62016-04-05 00:47:58 +0000210int SymbolBody::compare(SymbolBody *Other) {
Michael J. Spencer1b348a62015-09-04 22:28:10 +0000211 assert(!isLazy() && !Other->isLazy());
Rafael Espindola0bc0c022016-01-18 23:54:05 +0000212 std::tuple<bool, bool, bool> L(isDefined(), !isShared(), !isWeak());
213 std::tuple<bool, bool, bool> R(Other->isDefined(), !Other->isShared(),
214 !Other->isWeak());
Rui Ueyamaa7ccb292015-07-27 20:39:01 +0000215
Rafael Espindola3a63f3f2015-08-28 20:19:34 +0000216 // Normalize
217 if (L > R)
Peter Collingbourned0856a62016-04-05 00:47:58 +0000218 return -Other->compare(this);
Rui Ueyamaa7ccb292015-07-27 20:39:01 +0000219
Rafael Espindolaccfe3cb2016-04-04 14:04:16 +0000220 uint8_t V = getMinVisibility(getVisibility(), Other->getVisibility());
221 setVisibility(V);
222 Other->setVisibility(V);
Rafael Espindola78471f02015-09-01 23:12:52 +0000223
Rui Ueyama86696f32015-10-21 19:41:03 +0000224 if (IsUsedInRegularObj || Other->IsUsedInRegularObj)
225 IsUsedInRegularObj = Other->IsUsedInRegularObj = true;
Rafael Espindola18173d42015-09-08 15:50:05 +0000226
George Rimar02ca1792016-01-25 08:44:38 +0000227 // We want to export all symbols that exist both in the executable
228 // and in DSOs, so that the symbols in the executable can interrupt
229 // symbols in the DSO at runtime.
230 if (isShared() != Other->isShared())
Peter Collingbournee8afa492016-04-05 00:47:55 +0000231 if (isa<Defined>(isShared() ? Other : this)) {
232 IsUsedInRegularObj = Other->IsUsedInRegularObj = true;
Rafael Espindolaabebed92016-02-05 15:27:15 +0000233 MustBeInDynSym = Other->MustBeInDynSym = true;
Peter Collingbournee8afa492016-04-05 00:47:55 +0000234 }
George Rimar02ca1792016-01-25 08:44:38 +0000235
Rafael Espindola3a63f3f2015-08-28 20:19:34 +0000236 if (L != R)
237 return -1;
George Rimar3498c7f2016-03-10 18:49:24 +0000238 if (!isDefined() || isShared() || isWeak())
Rafael Espindola8e5560d2015-09-23 14:23:59 +0000239 return 1;
George Rimar3498c7f2016-03-10 18:49:24 +0000240 if (!isCommon() && !Other->isCommon())
241 return 0;
242 if (isCommon() && Other->isCommon())
243 return compareCommons(cast<DefinedCommon>(this),
244 cast<DefinedCommon>(Other));
George Rimar34358002016-03-14 09:19:30 +0000245 if (Config->WarnCommon)
246 warning("common " + this->getName() + " is overridden");
George Rimar3498c7f2016-03-10 18:49:24 +0000247 return isCommon() ? -1 : 1;
Michael J. Spencer84487f12015-07-24 21:03:07 +0000248}
Rafael Espindoladaa92a62015-08-31 01:16:19 +0000249
Rafael Espindolaf9b79a42016-04-06 12:14:31 +0000250Defined::Defined(Kind K, StringRef Name, uint8_t Binding, uint8_t StOther,
Rafael Espindolaccfe3cb2016-04-04 14:04:16 +0000251 uint8_t Type)
Rafael Espindolaf9b79a42016-04-06 12:14:31 +0000252 : SymbolBody(K, Name, Binding, StOther, Type) {}
Rafael Espindolaccfe3cb2016-04-04 14:04:16 +0000253
Rafael Espindolaf9b79a42016-04-06 12:14:31 +0000254Defined::Defined(Kind K, uint32_t NameOffset, uint8_t StOther, uint8_t Type)
255 : SymbolBody(K, NameOffset, StOther, Type) {}
Rafael Espindola4d4b06a2015-12-24 00:47:42 +0000256
Rafael Espindolaf9b79a42016-04-06 12:14:31 +0000257DefinedBitcode::DefinedBitcode(StringRef Name, bool IsWeak, uint8_t StOther)
Rafael Espindolaccfe3cb2016-04-04 14:04:16 +0000258 : Defined(DefinedBitcodeKind, Name, IsWeak ? STB_WEAK : STB_GLOBAL,
Rafael Espindolaf9b79a42016-04-06 12:14:31 +0000259 StOther, 0 /* Type */) {}
Rafael Espindola9f77ef02016-02-12 20:54:57 +0000260
261bool DefinedBitcode::classof(const SymbolBody *S) {
262 return S->kind() == DefinedBitcodeKind;
263}
264
Rafael Espindolaf4765732016-04-06 13:22:41 +0000265UndefinedBitcode::UndefinedBitcode(StringRef N, bool IsWeak, uint8_t StOther)
266 : SymbolBody(SymbolBody::UndefinedBitcodeKind, N,
267 IsWeak ? STB_WEAK : STB_GLOBAL, StOther, 0 /* Type */) {}
Rafael Espindola5d7593b2015-12-22 23:00:50 +0000268
269template <typename ELFT>
270UndefinedElf<ELFT>::UndefinedElf(StringRef N, const Elf_Sym &Sym)
Rafael Espindolaf4765732016-04-06 13:22:41 +0000271 : SymbolBody(SymbolBody::UndefinedElfKind, N, Sym.getBinding(),
272 Sym.st_other, Sym.getType()),
Rafael Espindolaccfe3cb2016-04-04 14:04:16 +0000273 Size(Sym.st_size) {}
274
275template <typename ELFT>
Rafael Espindolaf4765732016-04-06 13:22:41 +0000276UndefinedElf<ELFT>::UndefinedElf(StringRef Name, uint8_t Binding,
277 uint8_t StOther, uint8_t Type,
278 bool CanKeepUndefined)
Rafael Espindola5e345682016-04-06 14:31:03 +0000279 : SymbolBody(SymbolBody::UndefinedElfKind, Name, Binding, StOther, Type) {
280 this->CanKeepUndefined = CanKeepUndefined;
281}
Rafael Espindolaf4765732016-04-06 13:22:41 +0000282
283template <typename ELFT>
Rafael Espindolad9a17172016-04-05 11:47:46 +0000284UndefinedElf<ELFT>::UndefinedElf(const Elf_Sym &Sym)
Rafael Espindolaf4765732016-04-06 13:22:41 +0000285 : SymbolBody(SymbolBody::UndefinedElfKind, Sym.st_name, Sym.st_other,
286 Sym.getType()),
Rafael Espindolaccfe3cb2016-04-04 14:04:16 +0000287 Size(Sym.st_size) {
288 assert(Sym.getBinding() == STB_LOCAL);
289}
Rafael Espindola5d7593b2015-12-22 23:00:50 +0000290
Rafael Espindola4d4b06a2015-12-24 00:47:42 +0000291template <typename ELFT>
292DefinedSynthetic<ELFT>::DefinedSynthetic(StringRef N, uintX_t Value,
George Rimaraa4dc202016-03-01 16:23:13 +0000293 OutputSectionBase<ELFT> &Section,
Rafael Espindolaf9b79a42016-04-06 12:14:31 +0000294 uint8_t StOther)
295 : Defined(SymbolBody::DefinedSyntheticKind, N, STB_GLOBAL, StOther,
Davide Italiano255730c2016-03-04 01:55:28 +0000296 0 /* Type */),
Rafael Espindola4d4b06a2015-12-24 00:47:42 +0000297 Value(Value), Section(Section) {}
298
Rafael Espindola11191912015-12-24 16:23:37 +0000299DefinedCommon::DefinedCommon(StringRef N, uint64_t Size, uint64_t Alignment,
Rafael Espindolaf9b79a42016-04-06 12:14:31 +0000300 uint8_t Binding, uint8_t StOther, uint8_t Type)
301 : Defined(SymbolBody::DefinedCommonKind, N, Binding, StOther, Type),
Rui Ueyama17d69832016-03-10 18:58:53 +0000302 Alignment(Alignment), Size(Size) {}
Rafael Espindola11191912015-12-24 16:23:37 +0000303
Michael J. Spencer1b348a62015-09-04 22:28:10 +0000304std::unique_ptr<InputFile> Lazy::getMember() {
305 MemoryBufferRef MBRef = File->getMember(&Sym);
306
307 // getMember returns an empty buffer if the member was already
308 // read from the library.
309 if (MBRef.getBuffer().empty())
310 return std::unique_ptr<InputFile>(nullptr);
Rui Ueyama71c066d2016-02-02 08:22:41 +0000311 return createObjectFile(MBRef, File->getName());
Michael J. Spencer1b348a62015-09-04 22:28:10 +0000312}
313
Rui Ueyamaa4a628f2016-01-13 18:55:39 +0000314// Returns the demangled C++ symbol name for Name.
Rafael Espindolae0df00b2016-02-28 00:25:54 +0000315std::string elf::demangle(StringRef Name) {
Rui Ueyamaa4a628f2016-01-13 18:55:39 +0000316#if !defined(HAVE_CXXABI_H)
317 return Name;
318#else
319 if (!Config->Demangle)
320 return Name;
Rui Ueyama5fa978b2016-01-13 19:40:13 +0000321
Rui Ueyamadf154512016-01-13 22:09:09 +0000322 // __cxa_demangle can be used to demangle strings other than symbol
323 // names which do not necessarily start with "_Z". Name can be
324 // either a C or C++ symbol. Don't call __cxa_demangle if the name
325 // does not look like a C++ symbol name to avoid getting unexpected
326 // result for a C symbol that happens to match a mangled type name.
Rui Ueyama5fa978b2016-01-13 19:40:13 +0000327 if (!Name.startswith("_Z"))
328 return Name;
329
Rui Ueyamaa4a628f2016-01-13 18:55:39 +0000330 char *Buf =
331 abi::__cxa_demangle(Name.str().c_str(), nullptr, nullptr, nullptr);
332 if (!Buf)
333 return Name;
334 std::string S(Buf);
335 free(Buf);
336 return S;
337#endif
338}
339
Rafael Espindola87d9f102016-03-11 12:19:05 +0000340template uint32_t SymbolBody::template getVA<ELF32LE>(uint32_t) const;
341template uint32_t SymbolBody::template getVA<ELF32BE>(uint32_t) const;
342template uint64_t SymbolBody::template getVA<ELF64LE>(uint64_t) const;
343template uint64_t SymbolBody::template getVA<ELF64BE>(uint64_t) const;
Rui Ueyamab5a69702016-02-01 21:00:35 +0000344
345template uint32_t SymbolBody::template getGotVA<ELF32LE>() const;
346template uint32_t SymbolBody::template getGotVA<ELF32BE>() const;
347template uint64_t SymbolBody::template getGotVA<ELF64LE>() const;
348template uint64_t SymbolBody::template getGotVA<ELF64BE>() const;
349
Rafael Espindola74031ba2016-04-07 15:20:56 +0000350template uint32_t SymbolBody::template getGotOffset<ELF32LE>() const;
351template uint32_t SymbolBody::template getGotOffset<ELF32BE>() const;
352template uint64_t SymbolBody::template getGotOffset<ELF64LE>() const;
353template uint64_t SymbolBody::template getGotOffset<ELF64BE>() const;
354
Rui Ueyamab5a69702016-02-01 21:00:35 +0000355template uint32_t SymbolBody::template getGotPltVA<ELF32LE>() const;
356template uint32_t SymbolBody::template getGotPltVA<ELF32BE>() const;
357template uint64_t SymbolBody::template getGotPltVA<ELF64LE>() const;
358template uint64_t SymbolBody::template getGotPltVA<ELF64BE>() const;
359
Rafael Espindola74031ba2016-04-07 15:20:56 +0000360template uint32_t SymbolBody::template getGotPltOffset<ELF32LE>() const;
361template uint32_t SymbolBody::template getGotPltOffset<ELF32BE>() const;
362template uint64_t SymbolBody::template getGotPltOffset<ELF64LE>() const;
363template uint64_t SymbolBody::template getGotPltOffset<ELF64BE>() const;
364
Rui Ueyamab5a69702016-02-01 21:00:35 +0000365template uint32_t SymbolBody::template getPltVA<ELF32LE>() const;
366template uint32_t SymbolBody::template getPltVA<ELF32BE>() const;
367template uint64_t SymbolBody::template getPltVA<ELF64LE>() const;
368template uint64_t SymbolBody::template getPltVA<ELF64BE>() const;
369
Rui Ueyama512c61d2016-02-03 00:12:24 +0000370template uint32_t SymbolBody::template getSize<ELF32LE>() const;
371template uint32_t SymbolBody::template getSize<ELF32BE>() const;
372template uint64_t SymbolBody::template getSize<ELF64LE>() const;
373template uint64_t SymbolBody::template getSize<ELF64BE>() const;
374
Simon Atanasyan13f6da12016-03-31 21:26:23 +0000375template uint32_t SymbolBody::template getThunkVA<ELF32LE>() const;
376template uint32_t SymbolBody::template getThunkVA<ELF32BE>() const;
377template uint64_t SymbolBody::template getThunkVA<ELF64LE>() const;
378template uint64_t SymbolBody::template getThunkVA<ELF64BE>() const;
379
Rafael Espindolae0df00b2016-02-28 00:25:54 +0000380template class elf::UndefinedElf<ELF32LE>;
381template class elf::UndefinedElf<ELF32BE>;
382template class elf::UndefinedElf<ELF64LE>;
383template class elf::UndefinedElf<ELF64BE>;
Rafael Espindola4d4b06a2015-12-24 00:47:42 +0000384
Rafael Espindolae0df00b2016-02-28 00:25:54 +0000385template class elf::DefinedSynthetic<ELF32LE>;
386template class elf::DefinedSynthetic<ELF32BE>;
387template class elf::DefinedSynthetic<ELF64LE>;
388template class elf::DefinedSynthetic<ELF64BE>;