blob: f3edafaf4b7817a05a87d70529c0c37f219c580c [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"
Rui Ueyamaa3ac1732016-11-24 20:24:18 +000015#include "Strings.h"
Rui Ueyamae8a61022016-11-05 23:05:47 +000016#include "SyntheticSections.h"
Rui Ueyamab5a69702016-02-01 21:00:35 +000017#include "Target.h"
Rafael Espindola17cb7c02016-12-19 17:01:01 +000018#include "Writer.h"
Michael J. Spencer84487f12015-07-24 21:03:07 +000019
Michael J. Spencer1b348a62015-09-04 22:28:10 +000020#include "llvm/ADT/STLExtras.h"
Eugene Leviantc958d8d2016-10-12 08:19:30 +000021#include "llvm/Support/Path.h"
Rui Ueyamac72ba3a2016-11-23 04:57:25 +000022#include <cstring>
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: {
Rui Ueyama4f2f50d2016-12-21 08:40:09 +000038 auto &D = cast<DefinedSynthetic>(Body);
Rafael Espindolae08e78d2016-11-09 23:23:45 +000039 const OutputSectionBase *Sec = D.Section;
Peter Collingbourne6a422592016-05-03 01:21:08 +000040 if (!Sec)
41 return D.Value;
Rui Ueyama4f2f50d2016-12-21 08:40:09 +000042 if (D.Value == uintX_t(-1))
Rafael Espindola04a2e342016-11-09 01:42:41 +000043 return Sec->Addr + Sec->Size;
44 return Sec->Addr + D.Value;
Rui Ueyamab5a69702016-02-01 21:00:35 +000045 }
Rafael Espindola87d9f102016-03-11 12:19:05 +000046 case SymbolBody::DefinedRegularKind: {
47 auto &D = cast<DefinedRegular<ELFT>>(Body);
Sean Silva902ae3c2016-12-15 00:57:53 +000048 InputSectionBase<ELFT> *IS = D.Section;
Rui Ueyamab5a69702016-02-01 21:00:35 +000049
Rafael Espindolaccfe3cb2016-04-04 14:04:16 +000050 // According to the ELF spec reference to a local symbol from outside
51 // the group are not allowed. Unfortunately .eh_frame breaks that rule
52 // and must be treated specially. For now we just replace the symbol with
53 // 0.
Sean Silva902ae3c2016-12-15 00:57:53 +000054 if (IS == &InputSection<ELFT>::Discarded)
Rafael Espindolaccfe3cb2016-04-04 14:04:16 +000055 return 0;
56
Rui Ueyamab5a69702016-02-01 21:00:35 +000057 // This is an absolute symbol.
Sean Silva902ae3c2016-12-15 00:57:53 +000058 if (!IS)
Rafael Espindolaccfe3cb2016-04-04 14:04:16 +000059 return D.Value;
Rui Ueyamab5a69702016-02-01 21:00:35 +000060
Rafael Espindolaccfe3cb2016-04-04 14:04:16 +000061 uintX_t Offset = D.Value;
62 if (D.isSection()) {
Rafael Espindola1f5b70f2016-03-11 14:21:37 +000063 Offset += Addend;
64 Addend = 0;
65 }
Sean Silva902ae3c2016-12-15 00:57:53 +000066 uintX_t VA = (IS->OutSec ? IS->OutSec->Addr : 0) + IS->getOffset(Offset);
George Rimar6a3b1542016-10-04 08:52:51 +000067 if (D.isTls() && !Config->Relocatable) {
68 if (!Out<ELFT>::TlsPhdr)
Rui Ueyama3fc0f7e2016-11-23 18:07:33 +000069 fatal(toString(D.File) +
George Rimar6a3b1542016-10-04 08:52:51 +000070 " has a STT_TLS symbol but doesn't have a PT_TLS section");
Rafael Espindola1f5b70f2016-03-11 14:21:37 +000071 return VA - Out<ELFT>::TlsPhdr->p_vaddr;
George Rimar6a3b1542016-10-04 08:52:51 +000072 }
Rafael Espindola1f5b70f2016-03-11 14:21:37 +000073 return VA;
Rui Ueyamab5a69702016-02-01 21:00:35 +000074 }
Rui Ueyama07784902016-08-02 01:35:13 +000075 case SymbolBody::DefinedCommonKind:
Rafael Espindola04a2e342016-11-09 01:42:41 +000076 return In<ELFT>::Common->OutSec->Addr + In<ELFT>::Common->OutSecOff +
Rafael Espindolae7553e42016-08-31 13:28:33 +000077 cast<DefinedCommon>(Body).Offset;
Rafael Espindola87d9f102016-03-11 12:19:05 +000078 case SymbolBody::SharedKind: {
79 auto &SS = cast<SharedSymbol<ELFT>>(Body);
80 if (!SS.NeedsCopyOrPltAddr)
Rafael Espindolaa0a65f92016-02-09 15:11:01 +000081 return 0;
Rafael Espindolaccfe3cb2016-04-04 14:04:16 +000082 if (SS.isFunc())
Rafael Espindola87d9f102016-03-11 12:19:05 +000083 return Body.getPltVA<ELFT>();
Rafael Espindola04a2e342016-11-09 01:42:41 +000084 return Out<ELFT>::Bss->Addr + SS.OffsetInBss;
Rui Ueyamab5a69702016-02-01 21:00:35 +000085 }
Peter Collingbourne60976ed2016-04-27 00:05:06 +000086 case SymbolBody::UndefinedKind:
Rui Ueyamab5a69702016-02-01 21:00:35 +000087 return 0;
Rui Ueyamaf8baa662016-04-07 19:24:51 +000088 case SymbolBody::LazyArchiveKind:
89 case SymbolBody::LazyObjectKind:
Peter Collingbourne4f952702016-05-01 04:55:03 +000090 assert(Body.symbol()->IsUsedInRegularObj && "lazy symbol reached writer");
Rui Ueyamab5a69702016-02-01 21:00:35 +000091 return 0;
92 }
George Rimar777f9632016-03-12 08:31:34 +000093 llvm_unreachable("invalid symbol kind");
Rui Ueyamab5a69702016-02-01 21:00:35 +000094}
95
Rui Ueyamaa13efc22016-11-29 18:05:04 +000096SymbolBody::SymbolBody(Kind K, StringRefZ Name, bool IsLocal, uint8_t StOther,
97 uint8_t Type)
98 : SymbolKind(K), NeedsCopyOrPltAddr(false), IsLocal(IsLocal),
Peter Smithbaffdb82016-12-08 12:58:55 +000099 IsInGlobalMipsGot(false), Is32BitMipsGot(false), IsInIplt(false),
100 IsInIgot(false), Type(Type), StOther(StOther), Name(Name) {}
Rafael Espindolaf4765732016-04-06 13:22:41 +0000101
Rui Ueyamac4466602016-03-13 19:48:18 +0000102// Returns true if a symbol can be replaced at load-time by a symbol
103// with the same name defined in other ELF executable or DSO.
104bool SymbolBody::isPreemptible() const {
105 if (isLocal())
106 return false;
107
Rafael Espindola66434562016-05-05 19:41:49 +0000108 // Shared symbols resolve to the definition in the DSO. The exceptions are
109 // symbols with copy relocations (which resolve to .bss) or preempt plt
110 // entries (which resolve to that plt entry).
Rui Ueyamac4466602016-03-13 19:48:18 +0000111 if (isShared())
Rafael Espindola66434562016-05-05 19:41:49 +0000112 return !NeedsCopyOrPltAddr;
Rui Ueyamac4466602016-03-13 19:48:18 +0000113
Peter Collingbourne66ac1d62016-04-22 20:21:26 +0000114 // That's all that can be preempted in a non-DSO.
Rui Ueyamac4466602016-03-13 19:48:18 +0000115 if (!Config->Shared)
116 return false;
Peter Collingbourne66ac1d62016-04-22 20:21:26 +0000117
Peter Collingbournedbe41872016-04-24 04:29:59 +0000118 // Only symbols that appear in dynsym can be preempted.
Peter Collingbourne4f952702016-05-01 04:55:03 +0000119 if (!symbol()->includeInDynsym())
Rui Ueyamac4466602016-03-13 19:48:18 +0000120 return false;
Peter Collingbourne66ac1d62016-04-22 20:21:26 +0000121
Rafael Espindola580d7a12016-07-07 22:50:54 +0000122 // Only default visibility symbols can be preempted.
123 if (symbol()->Visibility != STV_DEFAULT)
124 return false;
125
126 // -Bsymbolic means that definitions are not preempted.
Peter Collingbournedbe41872016-04-24 04:29:59 +0000127 if (Config->Bsymbolic || (Config->BsymbolicFunctions && isFunc()))
128 return !isDefined();
Rafael Espindola580d7a12016-07-07 22:50:54 +0000129 return true;
Rui Ueyamac4466602016-03-13 19:48:18 +0000130}
131
Peter Smithfb05cd92016-07-08 16:10:27 +0000132template <class ELFT> bool SymbolBody::hasThunk() const {
133 if (auto *DR = dyn_cast<DefinedRegular<ELFT>>(this))
134 return DR->ThunkData != nullptr;
135 if (auto *S = dyn_cast<SharedSymbol<ELFT>>(this))
136 return S->ThunkData != nullptr;
137 return false;
138}
139
Rui Ueyamab5a69702016-02-01 21:00:35 +0000140template <class ELFT>
Rui Ueyama9328b2c2016-03-14 23:16:09 +0000141typename ELFT::uint SymbolBody::getVA(typename ELFT::uint Addend) const {
Rafael Espindola8381c562016-03-17 23:36:19 +0000142 typename ELFT::uint OutVA = getSymVA<ELFT>(*this, Addend);
143 return OutVA + Addend;
Rafael Espindola87d9f102016-03-11 12:19:05 +0000144}
145
Rui Ueyama9328b2c2016-03-14 23:16:09 +0000146template <class ELFT> typename ELFT::uint SymbolBody::getGotVA() const {
Eugene Leviantad4439e2016-11-11 11:33:32 +0000147 return In<ELFT>::Got->getVA() + getGotOffset<ELFT>();
Rafael Espindola74031ba2016-04-07 15:20:56 +0000148}
149
150template <class ELFT> typename ELFT::uint SymbolBody::getGotOffset() const {
Rui Ueyama803b1202016-07-13 18:55:14 +0000151 return GotIndex * Target->GotEntrySize;
Rui Ueyamab5a69702016-02-01 21:00:35 +0000152}
153
Rui Ueyama9328b2c2016-03-14 23:16:09 +0000154template <class ELFT> typename ELFT::uint SymbolBody::getGotPltVA() const {
Peter Smithbaffdb82016-12-08 12:58:55 +0000155 if (this->IsInIgot)
156 return In<ELFT>::IgotPlt->getVA() + getGotPltOffset<ELFT>();
Eugene Leviant41ca3272016-11-10 09:48:29 +0000157 return In<ELFT>::GotPlt->getVA() + getGotPltOffset<ELFT>();
Rafael Espindola74031ba2016-04-07 15:20:56 +0000158}
159
160template <class ELFT> typename ELFT::uint SymbolBody::getGotPltOffset() const {
Rui Ueyama803b1202016-07-13 18:55:14 +0000161 return GotPltIndex * Target->GotPltEntrySize;
Rui Ueyamab5a69702016-02-01 21:00:35 +0000162}
163
Rui Ueyama9328b2c2016-03-14 23:16:09 +0000164template <class ELFT> typename ELFT::uint SymbolBody::getPltVA() const {
Peter Smithbaffdb82016-12-08 12:58:55 +0000165 if (this->IsInIplt)
166 return In<ELFT>::Iplt->getVA() + PltIndex * Target->PltEntrySize;
Eugene Leviantff23d3e2016-11-18 14:35:03 +0000167 return In<ELFT>::Plt->getVA() + Target->PltHeaderSize +
Rui Ueyamab5a69702016-02-01 21:00:35 +0000168 PltIndex * Target->PltEntrySize;
169}
170
Simon Atanasyan13f6da12016-03-31 21:26:23 +0000171template <class ELFT> typename ELFT::uint SymbolBody::getThunkVA() const {
Peter Smithfb05cd92016-07-08 16:10:27 +0000172 if (const auto *DR = dyn_cast<DefinedRegular<ELFT>>(this))
173 return DR->ThunkData->getVA();
174 if (const auto *S = dyn_cast<SharedSymbol<ELFT>>(this))
175 return S->ThunkData->getVA();
Peter Smith97c6d78f2017-01-04 09:45:45 +0000176 if (const auto *S = dyn_cast<Undefined<ELFT>>(this))
177 return S->ThunkData->getVA();
Peter Smithfb05cd92016-07-08 16:10:27 +0000178 fatal("getThunkVA() not supported for Symbol class\n");
Simon Atanasyan13f6da12016-03-31 21:26:23 +0000179}
180
Rui Ueyama9328b2c2016-03-14 23:16:09 +0000181template <class ELFT> typename ELFT::uint SymbolBody::getSize() const {
Rafael Espindolae7553e42016-08-31 13:28:33 +0000182 if (const auto *C = dyn_cast<DefinedCommon>(this))
Rafael Espindolaccfe3cb2016-04-04 14:04:16 +0000183 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;
Rui Ueyama512c61d2016-02-03 00:12:24 +0000188 return 0;
189}
190
Rui Ueyama35fa6c52016-11-23 05:48:40 +0000191// If a symbol name contains '@', the characters after that is
192// a symbol version name. This function parses that.
193void SymbolBody::parseSymbolVersion() {
194 StringRef S = getName();
195 size_t Pos = S.find('@');
196 if (Pos == 0 || Pos == StringRef::npos)
197 return;
198 StringRef Verstr = S.substr(Pos + 1);
199 if (Verstr.empty())
200 return;
201
202 // Truncate the symbol name so that it doesn't include the version string.
Rui Ueyamaa13efc22016-11-29 18:05:04 +0000203 Name = {S.data(), Pos};
Rui Ueyama35fa6c52016-11-23 05:48:40 +0000204
Rafael Espindola2756e042017-01-06 22:30:35 +0000205 // If this is an undefined or shared symbol it is not a definition.
206 if (isUndefined() || isShared())
207 return;
208
Rui Ueyama35fa6c52016-11-23 05:48:40 +0000209 // '@@' in a symbol name means the default version.
210 // It is usually the most recent one.
211 bool IsDefault = (Verstr[0] == '@');
212 if (IsDefault)
213 Verstr = Verstr.substr(1);
214
215 for (VersionDefinition &Ver : Config->VersionDefinitions) {
216 if (Ver.Name != Verstr)
217 continue;
218
219 if (IsDefault)
220 symbol()->VersionId = Ver.Id;
221 else
222 symbol()->VersionId = Ver.Id | VERSYM_HIDDEN;
223 return;
224 }
225
226 // It is an error if the specified version is not defined.
Rui Ueyama44da9de2016-12-05 18:40:14 +0000227 error(toString(File) + ": symbol " + S + " has undefined version " + Verstr);
Rui Ueyama35fa6c52016-11-23 05:48:40 +0000228}
229
Rui Ueyamaa13efc22016-11-29 18:05:04 +0000230Defined::Defined(Kind K, StringRefZ Name, bool IsLocal, uint8_t StOther,
231 uint8_t Type)
232 : SymbolBody(K, Name, IsLocal, StOther, Type) {}
Rafael Espindola4d4b06a2015-12-24 00:47:42 +0000233
Simon Atanasyanf967f092016-09-29 12:58:36 +0000234template <class ELFT> bool DefinedRegular<ELFT>::isMipsPIC() const {
235 if (!Section || !isFunc())
236 return false;
237 return (this->StOther & STO_MIPS_MIPS16) == STO_MIPS_PIC ||
238 (Section->getFile()->getObj().getHeader()->e_flags & EF_MIPS_PIC);
239}
240
Peter Smith97c6d78f2017-01-04 09:45:45 +0000241template <typename ELFT>
242Undefined<ELFT>::Undefined(StringRefZ Name, bool IsLocal, uint8_t StOther,
243 uint8_t Type, InputFile *File)
Rui Ueyamaa13efc22016-11-29 18:05:04 +0000244 : SymbolBody(SymbolBody::UndefinedKind, Name, IsLocal, StOther, Type) {
Rui Ueyama434b5612016-07-17 03:11:46 +0000245 this->File = File;
246}
Rafael Espindola5d7593b2015-12-22 23:00:50 +0000247
Rui Ueyamaa13efc22016-11-29 18:05:04 +0000248DefinedCommon::DefinedCommon(StringRef Name, uint64_t Size, uint64_t Alignment,
Rafael Espindolae7553e42016-08-31 13:28:33 +0000249 uint8_t StOther, uint8_t Type, InputFile *File)
Rui Ueyamaa13efc22016-11-29 18:05:04 +0000250 : Defined(SymbolBody::DefinedCommonKind, Name, /*IsLocal=*/false, StOther,
251 Type),
Rui Ueyama2a7c1c12016-07-17 17:36:22 +0000252 Alignment(Alignment), Size(Size) {
253 this->File = File;
254}
Rafael Espindola11191912015-12-24 16:23:37 +0000255
Rui Ueyama55518e72016-10-28 20:57:25 +0000256InputFile *Lazy::fetch() {
Rui Ueyamaf8baa662016-04-07 19:24:51 +0000257 if (auto *S = dyn_cast<LazyArchive>(this))
Rui Ueyama55518e72016-10-28 20:57:25 +0000258 return S->fetch();
259 return cast<LazyObject>(this)->fetch();
Rui Ueyamaf8baa662016-04-07 19:24:51 +0000260}
261
Rui Ueyama434b5612016-07-17 03:11:46 +0000262LazyArchive::LazyArchive(ArchiveFile &File,
263 const llvm::object::Archive::Symbol S, uint8_t Type)
264 : Lazy(LazyArchiveKind, S.getName(), Type), Sym(S) {
265 this->File = &File;
266}
267
268LazyObject::LazyObject(StringRef Name, LazyObjectFile &File, uint8_t Type)
269 : Lazy(LazyObjectKind, Name, Type) {
270 this->File = &File;
271}
272
Rui Ueyama55518e72016-10-28 20:57:25 +0000273InputFile *LazyArchive::fetch() {
Davide Italianobcdd6c62016-10-12 19:35:54 +0000274 std::pair<MemoryBufferRef, uint64_t> MBInfo = file()->getMember(&Sym);
Michael J. Spencer1b348a62015-09-04 22:28:10 +0000275
276 // getMember returns an empty buffer if the member was already
277 // read from the library.
Davide Italianobcdd6c62016-10-12 19:35:54 +0000278 if (MBInfo.first.getBuffer().empty())
Rui Ueyama38dbd3e2016-09-14 00:05:51 +0000279 return nullptr;
Rui Ueyama55518e72016-10-28 20:57:25 +0000280 return createObjectFile(MBInfo.first, file()->getName(), MBInfo.second);
Michael J. Spencer1b348a62015-09-04 22:28:10 +0000281}
282
Rui Ueyama55518e72016-10-28 20:57:25 +0000283InputFile *LazyObject::fetch() {
Rui Ueyama434b5612016-07-17 03:11:46 +0000284 MemoryBufferRef MBRef = file()->getBuffer();
Rafael Espindola65c65ce2016-06-14 21:56:36 +0000285 if (MBRef.getBuffer().empty())
Rui Ueyama38dbd3e2016-09-14 00:05:51 +0000286 return nullptr;
Rui Ueyama55518e72016-10-28 20:57:25 +0000287 return createObjectFile(MBRef);
Rui Ueyamaf8baa662016-04-07 19:24:51 +0000288}
289
Peter Collingbournedadcc172016-04-22 18:42:48 +0000290bool Symbol::includeInDynsym() const {
291 if (Visibility != STV_DEFAULT && Visibility != STV_PROTECTED)
Rafael Espindolaae605c12016-04-21 20:35:25 +0000292 return false;
George Rimard3566302016-06-20 11:55:12 +0000293 return (ExportDynamic && VersionId != VER_NDX_LOCAL) || body()->isShared() ||
Peter Collingbourne4f952702016-05-01 04:55:03 +0000294 (body()->isUndefined() && Config->Shared);
Rafael Espindolaae605c12016-04-21 20:35:25 +0000295}
Rui Ueyama69c778c2016-07-17 17:50:09 +0000296
297// Print out a log message for --trace-symbol.
298void elf::printTraceSymbol(Symbol *Sym) {
299 SymbolBody *B = Sym->body();
Rui Ueyama3fc0f7e2016-11-23 18:07:33 +0000300 outs() << toString(B->File);
Rui Ueyama69c778c2016-07-17 17:50:09 +0000301
302 if (B->isUndefined())
303 outs() << ": reference to ";
304 else if (B->isCommon())
305 outs() << ": common definition of ";
306 else
307 outs() << ": definition of ";
308 outs() << B->getName() << "\n";
309}
310
Rui Ueyamaa3ac1732016-11-24 20:24:18 +0000311// Returns a symbol for an error message.
Rui Ueyamace039262017-01-06 10:04:08 +0000312std::string lld::toString(const SymbolBody &B) {
Rui Ueyamaa3ac1732016-11-24 20:24:18 +0000313 if (Config->Demangle)
Rui Ueyama4c5b8ce2016-12-07 23:17:05 +0000314 if (Optional<std::string> S = demangle(B.getName()))
315 return *S;
Rui Ueyamaa3ac1732016-11-24 20:24:18 +0000316 return B.getName();
317}
318
Peter Smithfb05cd92016-07-08 16:10:27 +0000319template bool SymbolBody::hasThunk<ELF32LE>() const;
320template bool SymbolBody::hasThunk<ELF32BE>() const;
321template bool SymbolBody::hasThunk<ELF64LE>() const;
322template bool SymbolBody::hasThunk<ELF64BE>() const;
Rafael Espindolaae605c12016-04-21 20:35:25 +0000323
Rafael Espindola87d9f102016-03-11 12:19:05 +0000324template uint32_t SymbolBody::template getVA<ELF32LE>(uint32_t) const;
325template uint32_t SymbolBody::template getVA<ELF32BE>(uint32_t) const;
326template uint64_t SymbolBody::template getVA<ELF64LE>(uint64_t) const;
327template uint64_t SymbolBody::template getVA<ELF64BE>(uint64_t) const;
Rui Ueyamab5a69702016-02-01 21:00:35 +0000328
329template uint32_t SymbolBody::template getGotVA<ELF32LE>() const;
330template uint32_t SymbolBody::template getGotVA<ELF32BE>() const;
331template uint64_t SymbolBody::template getGotVA<ELF64LE>() const;
332template uint64_t SymbolBody::template getGotVA<ELF64BE>() const;
333
Rafael Espindola74031ba2016-04-07 15:20:56 +0000334template uint32_t SymbolBody::template getGotOffset<ELF32LE>() const;
335template uint32_t SymbolBody::template getGotOffset<ELF32BE>() const;
336template uint64_t SymbolBody::template getGotOffset<ELF64LE>() const;
337template uint64_t SymbolBody::template getGotOffset<ELF64BE>() const;
338
Rui Ueyamab5a69702016-02-01 21:00:35 +0000339template uint32_t SymbolBody::template getGotPltVA<ELF32LE>() const;
340template uint32_t SymbolBody::template getGotPltVA<ELF32BE>() const;
341template uint64_t SymbolBody::template getGotPltVA<ELF64LE>() const;
342template uint64_t SymbolBody::template getGotPltVA<ELF64BE>() const;
343
Peter Smithfb05cd92016-07-08 16:10:27 +0000344template uint32_t SymbolBody::template getThunkVA<ELF32LE>() const;
345template uint32_t SymbolBody::template getThunkVA<ELF32BE>() const;
346template uint64_t SymbolBody::template getThunkVA<ELF64LE>() const;
347template uint64_t SymbolBody::template getThunkVA<ELF64BE>() const;
348
Rafael Espindola74031ba2016-04-07 15:20:56 +0000349template uint32_t SymbolBody::template getGotPltOffset<ELF32LE>() const;
350template uint32_t SymbolBody::template getGotPltOffset<ELF32BE>() const;
351template uint64_t SymbolBody::template getGotPltOffset<ELF64LE>() const;
352template uint64_t SymbolBody::template getGotPltOffset<ELF64BE>() const;
353
Rui Ueyamab5a69702016-02-01 21:00:35 +0000354template uint32_t SymbolBody::template getPltVA<ELF32LE>() const;
355template uint32_t SymbolBody::template getPltVA<ELF32BE>() const;
356template uint64_t SymbolBody::template getPltVA<ELF64LE>() const;
357template uint64_t SymbolBody::template getPltVA<ELF64BE>() const;
358
Rui Ueyama512c61d2016-02-03 00:12:24 +0000359template uint32_t SymbolBody::template getSize<ELF32LE>() const;
360template uint32_t SymbolBody::template getSize<ELF32BE>() const;
361template uint64_t SymbolBody::template getSize<ELF64LE>() const;
362template uint64_t SymbolBody::template getSize<ELF64BE>() const;
363
Peter Smith97c6d78f2017-01-04 09:45:45 +0000364template class elf::Undefined<ELF32LE>;
365template class elf::Undefined<ELF32BE>;
366template class elf::Undefined<ELF64LE>;
367template class elf::Undefined<ELF64BE>;
368
Simon Atanasyanf967f092016-09-29 12:58:36 +0000369template class elf::DefinedRegular<ELF32LE>;
370template class elf::DefinedRegular<ELF32BE>;
371template class elf::DefinedRegular<ELF64LE>;
372template class elf::DefinedRegular<ELF64BE>;