blob: 62906be84c768a3b0944f9c7a21c4e5eccece98c [file] [log] [blame]
Michael J. Spencer84487f12015-07-24 21:03:071//===- 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:1911#include "Error.h"
Michael J. Spencercdae0a42015-07-28 22:58:2512#include "InputFiles.h"
Rui Ueyamab5a69702016-02-01 21:00:3513#include "InputSection.h"
14#include "OutputSections.h"
Rui Ueyamaa3ac1732016-11-24 20:24:1815#include "Strings.h"
Rui Ueyamae8a61022016-11-05 23:05:4716#include "SyntheticSections.h"
Rui Ueyamab5a69702016-02-01 21:00:3517#include "Target.h"
Rafael Espindola17cb7c02016-12-19 17:01:0118#include "Writer.h"
Michael J. Spencer84487f12015-07-24 21:03:0719
Michael J. Spencer1b348a62015-09-04 22:28:1020#include "llvm/ADT/STLExtras.h"
Eugene Leviantc958d8d2016-10-12 08:19:3021#include "llvm/Support/Path.h"
Rui Ueyamac72ba3a2016-11-23 04:57:2522#include <cstring>
Michael J. Spencer1b348a62015-09-04 22:28:1023
24using namespace llvm;
Michael J. Spencer84487f12015-07-24 21:03:0725using namespace llvm::object;
Rafael Espindola78471f02015-09-01 23:12:5226using namespace llvm::ELF;
Michael J. Spencer84487f12015-07-24 21:03:0727
28using namespace lld;
Rafael Espindolae0df00b2016-02-28 00:25:5429using namespace lld::elf;
Michael J. Spencer84487f12015-07-24 21:03:0730
Rui Ueyamab5a69702016-02-01 21:00:3531template <class ELFT>
Rafael Espindola7386cea2017-02-16 00:12:3432static typename ELFT::uint getSymVA(const SymbolBody &Body, int64_t &Addend) {
Rui Ueyama9328b2c2016-03-14 23:16:0933 typedef typename ELFT::uint uintX_t;
Rafael Espindola87d9f102016-03-11 12:19:0534
35 switch (Body.kind()) {
36 case SymbolBody::DefinedSyntheticKind: {
Rui Ueyama4f2f50d2016-12-21 08:40:0937 auto &D = cast<DefinedSynthetic>(Body);
Rafael Espindola24e6f362017-02-24 15:07:3038 const OutputSection *Sec = D.Section;
Peter Collingbourne6a422592016-05-03 01:21:0839 if (!Sec)
40 return D.Value;
Rui Ueyama4f2f50d2016-12-21 08:40:0941 if (D.Value == uintX_t(-1))
Rafael Espindola04a2e342016-11-09 01:42:4142 return Sec->Addr + Sec->Size;
43 return Sec->Addr + D.Value;
Rui Ueyamab5a69702016-02-01 21:00:3544 }
Rafael Espindola87d9f102016-03-11 12:19:0545 case SymbolBody::DefinedRegularKind: {
46 auto &D = cast<DefinedRegular<ELFT>>(Body);
Rafael Espindolab4c9b812017-02-23 02:28:2847 InputSectionBase *IS = D.Section;
Rui Ueyamab5a69702016-02-01 21:00:3548
Rafael Espindolaccfe3cb2016-04-04 14:04:1649 // According to the ELF spec reference to a local symbol from outside
50 // the group are not allowed. Unfortunately .eh_frame breaks that rule
51 // and must be treated specially. For now we just replace the symbol with
52 // 0.
Rafael Espindola774ea7d2017-02-23 16:49:0753 if (IS == &InputSection::Discarded)
Rafael Espindolaccfe3cb2016-04-04 14:04:1654 return 0;
55
Rui Ueyamab5a69702016-02-01 21:00:3556 // This is an absolute symbol.
Sean Silva902ae3c2016-12-15 00:57:5357 if (!IS)
Rafael Espindolaccfe3cb2016-04-04 14:04:1658 return D.Value;
Rui Ueyamab5a69702016-02-01 21:00:3559
Rafael Espindolaccfe3cb2016-04-04 14:04:1660 uintX_t Offset = D.Value;
Sean Silvaa9ba4502017-02-28 08:32:5661
62 // An object in an SHF_MERGE section might be referenced via a
63 // section symbol (as a hack for reducing the number of local
64 // symbols).
65 // We must incorporate the addend into the section offset (and
66 // zero out the addend for later processing) so that we find the
67 // right object in the section.
68 // Note that for an ordinary symbol we do not perform this
69 // adjustment and thus effectively assume that the addend cannot
70 // cross the boundaries of mergeable objects.
Rafael Espindolaccfe3cb2016-04-04 14:04:1671 if (D.isSection()) {
Rafael Espindola1f5b70f2016-03-11 14:21:3772 Offset += Addend;
73 Addend = 0;
74 }
Sean Silvaa9ba4502017-02-28 08:32:5675
Rafael Espindola24e6f362017-02-24 15:07:3076 const OutputSection *OutSec = IS->getOutputSection<ELFT>();
Rafael Espindolab4c9b812017-02-23 02:28:2877 uintX_t VA = (OutSec ? OutSec->Addr : 0) + IS->getOffset<ELFT>(Offset);
George Rimar6a3b1542016-10-04 08:52:5178 if (D.isTls() && !Config->Relocatable) {
Rui Ueyama9d1bacb12017-02-27 02:31:2679 if (!Out::TlsPhdr)
Rui Ueyama3fc0f7e2016-11-23 18:07:3380 fatal(toString(D.File) +
George Rimar6a3b1542016-10-04 08:52:5181 " has a STT_TLS symbol but doesn't have a PT_TLS section");
Rui Ueyama9d1bacb12017-02-27 02:31:2682 return VA - Out::TlsPhdr->p_vaddr;
George Rimar6a3b1542016-10-04 08:52:5183 }
Rafael Espindola1f5b70f2016-03-11 14:21:3784 return VA;
Rui Ueyamab5a69702016-02-01 21:00:3585 }
Rui Ueyama07784902016-08-02 01:35:1386 case SymbolBody::DefinedCommonKind:
Rui Ueyamab2a23cf2017-01-24 03:41:2087 if (!Config->DefineCommon)
88 return 0;
Rafael Espindola04a2e342016-11-09 01:42:4189 return In<ELFT>::Common->OutSec->Addr + In<ELFT>::Common->OutSecOff +
Rafael Espindolae7553e42016-08-31 13:28:3390 cast<DefinedCommon>(Body).Offset;
Rafael Espindola87d9f102016-03-11 12:19:0591 case SymbolBody::SharedKind: {
Rui Ueyama4076fa12017-02-26 23:35:3492 auto &SS = cast<SharedSymbol>(Body);
Rui Ueyamaf829e8c2017-02-16 06:12:4193 if (SS.NeedsCopy)
94 return SS.Section->OutSec->Addr + SS.Section->OutSecOff;
Rui Ueyama924b3612017-02-16 06:12:2295 if (SS.NeedsPltAddr)
Rafael Espindola87d9f102016-03-11 12:19:0596 return Body.getPltVA<ELFT>();
Rui Ueyama924b3612017-02-16 06:12:2297 return 0;
Rui Ueyamab5a69702016-02-01 21:00:3598 }
Peter Collingbourne60976ed2016-04-27 00:05:0699 case SymbolBody::UndefinedKind:
Rui Ueyamab5a69702016-02-01 21:00:35100 return 0;
Rui Ueyamaf8baa662016-04-07 19:24:51101 case SymbolBody::LazyArchiveKind:
102 case SymbolBody::LazyObjectKind:
Peter Collingbourne4f952702016-05-01 04:55:03103 assert(Body.symbol()->IsUsedInRegularObj && "lazy symbol reached writer");
Rui Ueyamab5a69702016-02-01 21:00:35104 return 0;
105 }
George Rimar777f9632016-03-12 08:31:34106 llvm_unreachable("invalid symbol kind");
Rui Ueyamab5a69702016-02-01 21:00:35107}
108
Rui Ueyamaa13efc22016-11-29 18:05:04109SymbolBody::SymbolBody(Kind K, StringRefZ Name, bool IsLocal, uint8_t StOther,
110 uint8_t Type)
Rui Ueyama924b3612017-02-16 06:12:22111 : SymbolKind(K), NeedsCopy(false), NeedsPltAddr(false), IsLocal(IsLocal),
Peter Smithbaffdb82016-12-08 12:58:55112 IsInGlobalMipsGot(false), Is32BitMipsGot(false), IsInIplt(false),
Rui Ueyama924b3612017-02-16 06:12:22113 IsInIgot(false), Type(Type), StOther(StOther), Name(Name) {}
Rafael Espindolaf4765732016-04-06 13:22:41114
Rui Ueyamac4466602016-03-13 19:48:18115// Returns true if a symbol can be replaced at load-time by a symbol
116// with the same name defined in other ELF executable or DSO.
117bool SymbolBody::isPreemptible() const {
118 if (isLocal())
119 return false;
120
Rafael Espindola66434562016-05-05 19:41:49121 // Shared symbols resolve to the definition in the DSO. The exceptions are
122 // symbols with copy relocations (which resolve to .bss) or preempt plt
123 // entries (which resolve to that plt entry).
Rui Ueyamac4466602016-03-13 19:48:18124 if (isShared())
Rui Ueyama924b3612017-02-16 06:12:22125 return !NeedsCopy && !NeedsPltAddr;
Rui Ueyamac4466602016-03-13 19:48:18126
Peter Collingbourne66ac1d62016-04-22 20:21:26127 // That's all that can be preempted in a non-DSO.
Rui Ueyamac4466602016-03-13 19:48:18128 if (!Config->Shared)
129 return false;
Peter Collingbourne66ac1d62016-04-22 20:21:26130
Peter Collingbournedbe41872016-04-24 04:29:59131 // Only symbols that appear in dynsym can be preempted.
Peter Collingbourne4f952702016-05-01 04:55:03132 if (!symbol()->includeInDynsym())
Rui Ueyamac4466602016-03-13 19:48:18133 return false;
Peter Collingbourne66ac1d62016-04-22 20:21:26134
Rafael Espindola580d7a12016-07-07 22:50:54135 // Only default visibility symbols can be preempted.
136 if (symbol()->Visibility != STV_DEFAULT)
137 return false;
138
139 // -Bsymbolic means that definitions are not preempted.
Peter Collingbournedbe41872016-04-24 04:29:59140 if (Config->Bsymbolic || (Config->BsymbolicFunctions && isFunc()))
141 return !isDefined();
Rafael Espindola580d7a12016-07-07 22:50:54142 return true;
Rui Ueyamac4466602016-03-13 19:48:18143}
144
Rui Ueyamab5a69702016-02-01 21:00:35145template <class ELFT>
Rafael Espindola7386cea2017-02-16 00:12:34146typename ELFT::uint SymbolBody::getVA(int64_t Addend) const {
Rafael Espindola8381c562016-03-17 23:36:19147 typename ELFT::uint OutVA = getSymVA<ELFT>(*this, Addend);
148 return OutVA + Addend;
Rafael Espindola87d9f102016-03-11 12:19:05149}
150
Rui Ueyama9328b2c2016-03-14 23:16:09151template <class ELFT> typename ELFT::uint SymbolBody::getGotVA() const {
Eugene Leviantad4439e2016-11-11 11:33:32152 return In<ELFT>::Got->getVA() + getGotOffset<ELFT>();
Rafael Espindola74031ba2016-04-07 15:20:56153}
154
155template <class ELFT> typename ELFT::uint SymbolBody::getGotOffset() const {
Rui Ueyama803b1202016-07-13 18:55:14156 return GotIndex * Target->GotEntrySize;
Rui Ueyamab5a69702016-02-01 21:00:35157}
158
Rui Ueyama9328b2c2016-03-14 23:16:09159template <class ELFT> typename ELFT::uint SymbolBody::getGotPltVA() const {
Peter Smithbaffdb82016-12-08 12:58:55160 if (this->IsInIgot)
161 return In<ELFT>::IgotPlt->getVA() + getGotPltOffset<ELFT>();
Eugene Leviant41ca3272016-11-10 09:48:29162 return In<ELFT>::GotPlt->getVA() + getGotPltOffset<ELFT>();
Rafael Espindola74031ba2016-04-07 15:20:56163}
164
165template <class ELFT> typename ELFT::uint SymbolBody::getGotPltOffset() const {
Rui Ueyama803b1202016-07-13 18:55:14166 return GotPltIndex * Target->GotPltEntrySize;
Rui Ueyamab5a69702016-02-01 21:00:35167}
168
Rui Ueyama9328b2c2016-03-14 23:16:09169template <class ELFT> typename ELFT::uint SymbolBody::getPltVA() const {
Peter Smithbaffdb82016-12-08 12:58:55170 if (this->IsInIplt)
171 return In<ELFT>::Iplt->getVA() + PltIndex * Target->PltEntrySize;
Eugene Leviantff23d3e2016-11-18 14:35:03172 return In<ELFT>::Plt->getVA() + Target->PltHeaderSize +
Rui Ueyamab5a69702016-02-01 21:00:35173 PltIndex * Target->PltEntrySize;
174}
175
Rui Ueyama9328b2c2016-03-14 23:16:09176template <class ELFT> typename ELFT::uint SymbolBody::getSize() const {
Rafael Espindolae7553e42016-08-31 13:28:33177 if (const auto *C = dyn_cast<DefinedCommon>(this))
Rafael Espindolaccfe3cb2016-04-04 14:04:16178 return C->Size;
179 if (const auto *DR = dyn_cast<DefinedRegular<ELFT>>(this))
180 return DR->Size;
Rui Ueyama4076fa12017-02-26 23:35:34181 if (const auto *S = dyn_cast<SharedSymbol>(this))
182 return S->getSize<ELFT>();
Rui Ueyama512c61d2016-02-03 00:12:24183 return 0;
184}
185
Rui Ueyama968db482017-02-28 04:02:42186template <class ELFT>
187const OutputSection *SymbolBody::getOutputSection() const {
188 if (auto *S = dyn_cast<DefinedRegular<ELFT>>(this)) {
189 if (S->Section)
190 return S->Section->template getOutputSection<ELFT>();
191 return nullptr;
192 }
193
194 if (auto *S = dyn_cast<SharedSymbol>(this)) {
195 if (S->NeedsCopy)
196 return S->Section->OutSec;
197 return nullptr;
198 }
199
200 if (isa<DefinedCommon>(this)) {
201 if (Config->DefineCommon)
202 return In<ELFT>::Common->OutSec;
203 return nullptr;
204 }
205
206 if (auto *S = dyn_cast<DefinedSynthetic>(this))
207 return S->Section;
208 return nullptr;
209}
210
Rui Ueyama35fa6c52016-11-23 05:48:40211// If a symbol name contains '@', the characters after that is
212// a symbol version name. This function parses that.
213void SymbolBody::parseSymbolVersion() {
214 StringRef S = getName();
215 size_t Pos = S.find('@');
216 if (Pos == 0 || Pos == StringRef::npos)
217 return;
218 StringRef Verstr = S.substr(Pos + 1);
219 if (Verstr.empty())
220 return;
221
222 // Truncate the symbol name so that it doesn't include the version string.
Rui Ueyamaa13efc22016-11-29 18:05:04223 Name = {S.data(), Pos};
Rui Ueyama35fa6c52016-11-23 05:48:40224
Rafael Espindola1d6d1b42017-01-17 16:08:06225 // If this is not in this DSO, it is not a definition.
226 if (!isInCurrentDSO())
Rafael Espindola2756e042017-01-06 22:30:35227 return;
228
Rui Ueyama35fa6c52016-11-23 05:48:40229 // '@@' in a symbol name means the default version.
230 // It is usually the most recent one.
231 bool IsDefault = (Verstr[0] == '@');
232 if (IsDefault)
233 Verstr = Verstr.substr(1);
234
235 for (VersionDefinition &Ver : Config->VersionDefinitions) {
236 if (Ver.Name != Verstr)
237 continue;
238
239 if (IsDefault)
240 symbol()->VersionId = Ver.Id;
241 else
242 symbol()->VersionId = Ver.Id | VERSYM_HIDDEN;
243 return;
244 }
245
246 // It is an error if the specified version is not defined.
Rui Ueyama44da9de2016-12-05 18:40:14247 error(toString(File) + ": symbol " + S + " has undefined version " + Verstr);
Rui Ueyama35fa6c52016-11-23 05:48:40248}
249
Rui Ueyamaa13efc22016-11-29 18:05:04250Defined::Defined(Kind K, StringRefZ Name, bool IsLocal, uint8_t StOther,
251 uint8_t Type)
252 : SymbolBody(K, Name, IsLocal, StOther, Type) {}
Rafael Espindola4d4b06a2015-12-24 00:47:42253
Simon Atanasyanf967f092016-09-29 12:58:36254template <class ELFT> bool DefinedRegular<ELFT>::isMipsPIC() const {
255 if (!Section || !isFunc())
256 return false;
257 return (this->StOther & STO_MIPS_MIPS16) == STO_MIPS_PIC ||
Rafael Espindolab4c9b812017-02-23 02:28:28258 (Section->getFile<ELFT>()->getObj().getHeader()->e_flags &
259 EF_MIPS_PIC);
Simon Atanasyanf967f092016-09-29 12:58:36260}
261
Peter Smith3a52eb02017-02-01 10:26:03262Undefined::Undefined(StringRefZ Name, bool IsLocal, uint8_t StOther,
263 uint8_t Type, InputFile *File)
Rui Ueyamaa13efc22016-11-29 18:05:04264 : SymbolBody(SymbolBody::UndefinedKind, Name, IsLocal, StOther, Type) {
Rui Ueyama434b5612016-07-17 03:11:46265 this->File = File;
266}
Rafael Espindola5d7593b2015-12-22 23:00:50267
Rui Ueyamaa13efc22016-11-29 18:05:04268DefinedCommon::DefinedCommon(StringRef Name, uint64_t Size, uint64_t Alignment,
Rafael Espindolae7553e42016-08-31 13:28:33269 uint8_t StOther, uint8_t Type, InputFile *File)
Rui Ueyamaa13efc22016-11-29 18:05:04270 : Defined(SymbolBody::DefinedCommonKind, Name, /*IsLocal=*/false, StOther,
271 Type),
Rui Ueyama2a7c1c12016-07-17 17:36:22272 Alignment(Alignment), Size(Size) {
273 this->File = File;
274}
Rafael Espindola11191912015-12-24 16:23:37275
Rui Ueyama4076fa12017-02-26 23:35:34276// If a shared symbol is referred via a copy relocation, its alignment
277// becomes part of the ABI. This function returns a symbol alignment.
278// Because symbols don't have alignment attributes, we need to infer that.
279template <class ELFT> uint64_t SharedSymbol::getAlignment() const {
280 auto *File = cast<SharedFile<ELFT>>(this->File);
281 uint64_t SecAlign = File->getSection(getSym<ELFT>())->sh_addralign;
282 uint64_t SymValue = getSym<ELFT>().st_value;
283 uint64_t SymAlign = uint64_t(1) << countTrailingZeros(SymValue);
284 return std::min(SecAlign, SymAlign);
285}
286
Rui Ueyama55518e72016-10-28 20:57:25287InputFile *Lazy::fetch() {
Rui Ueyamaf8baa662016-04-07 19:24:51288 if (auto *S = dyn_cast<LazyArchive>(this))
Rui Ueyama55518e72016-10-28 20:57:25289 return S->fetch();
290 return cast<LazyObject>(this)->fetch();
Rui Ueyamaf8baa662016-04-07 19:24:51291}
292
Rui Ueyama434b5612016-07-17 03:11:46293LazyArchive::LazyArchive(ArchiveFile &File,
294 const llvm::object::Archive::Symbol S, uint8_t Type)
295 : Lazy(LazyArchiveKind, S.getName(), Type), Sym(S) {
296 this->File = &File;
297}
298
299LazyObject::LazyObject(StringRef Name, LazyObjectFile &File, uint8_t Type)
300 : Lazy(LazyObjectKind, Name, Type) {
301 this->File = &File;
302}
303
Rui Ueyama55518e72016-10-28 20:57:25304InputFile *LazyArchive::fetch() {
Davide Italianobcdd6c62016-10-12 19:35:54305 std::pair<MemoryBufferRef, uint64_t> MBInfo = file()->getMember(&Sym);
Michael J. Spencer1b348a62015-09-04 22:28:10306
307 // getMember returns an empty buffer if the member was already
308 // read from the library.
Davide Italianobcdd6c62016-10-12 19:35:54309 if (MBInfo.first.getBuffer().empty())
Rui Ueyama38dbd3e2016-09-14 00:05:51310 return nullptr;
Rui Ueyama55518e72016-10-28 20:57:25311 return createObjectFile(MBInfo.first, file()->getName(), MBInfo.second);
Michael J. Spencer1b348a62015-09-04 22:28:10312}
313
Rui Ueyama55518e72016-10-28 20:57:25314InputFile *LazyObject::fetch() {
Rui Ueyama434b5612016-07-17 03:11:46315 MemoryBufferRef MBRef = file()->getBuffer();
Rafael Espindola65c65ce2016-06-14 21:56:36316 if (MBRef.getBuffer().empty())
Rui Ueyama38dbd3e2016-09-14 00:05:51317 return nullptr;
Rui Ueyama55518e72016-10-28 20:57:25318 return createObjectFile(MBRef);
Rui Ueyamaf8baa662016-04-07 19:24:51319}
320
Rafael Espindolab7e2ee22017-01-10 17:08:13321uint8_t Symbol::computeBinding() const {
322 if (Config->Relocatable)
323 return Binding;
Peter Collingbournedadcc172016-04-22 18:42:48324 if (Visibility != STV_DEFAULT && Visibility != STV_PROTECTED)
Rafael Espindolab7e2ee22017-01-10 17:08:13325 return STB_LOCAL;
Rafael Espindola41a93a32017-01-16 17:35:23326 const SymbolBody *Body = body();
Rafael Espindola1d6d1b42017-01-17 16:08:06327 if (VersionId == VER_NDX_LOCAL && Body->isInCurrentDSO())
Rafael Espindolab7e2ee22017-01-10 17:08:13328 return STB_LOCAL;
329 if (Config->NoGnuUnique && Binding == STB_GNU_UNIQUE)
330 return STB_GLOBAL;
331 return Binding;
332}
333
334bool Symbol::includeInDynsym() const {
335 if (computeBinding() == STB_LOCAL)
Rafael Espindolaae605c12016-04-21 20:35:25336 return false;
Rafael Espindolab7e2ee22017-01-10 17:08:13337 return ExportDynamic || body()->isShared() ||
Peter Collingbourne4f952702016-05-01 04:55:03338 (body()->isUndefined() && Config->Shared);
Rafael Espindolaae605c12016-04-21 20:35:25339}
Rui Ueyama69c778c2016-07-17 17:50:09340
341// Print out a log message for --trace-symbol.
342void elf::printTraceSymbol(Symbol *Sym) {
343 SymbolBody *B = Sym->body();
Rui Ueyamae6e206d2017-02-21 23:22:56344 std::string S;
Rui Ueyama69c778c2016-07-17 17:50:09345 if (B->isUndefined())
Rui Ueyamae6e206d2017-02-21 23:22:56346 S = ": reference to ";
Rui Ueyama69c778c2016-07-17 17:50:09347 else if (B->isCommon())
Rui Ueyamae6e206d2017-02-21 23:22:56348 S = ": common definition of ";
Rui Ueyama69c778c2016-07-17 17:50:09349 else
Rui Ueyamae6e206d2017-02-21 23:22:56350 S = ": definition of ";
351
352 message(toString(B->File) + S + B->getName());
Rui Ueyama69c778c2016-07-17 17:50:09353}
354
Rui Ueyamaa3ac1732016-11-24 20:24:18355// Returns a symbol for an error message.
Rui Ueyamace039262017-01-06 10:04:08356std::string lld::toString(const SymbolBody &B) {
Rui Ueyamaa3ac1732016-11-24 20:24:18357 if (Config->Demangle)
Rui Ueyama4c5b8ce2016-12-07 23:17:05358 if (Optional<std::string> S = demangle(B.getName()))
359 return *S;
Rui Ueyamaa3ac1732016-11-24 20:24:18360 return B.getName();
361}
362
Rafael Espindola7386cea2017-02-16 00:12:34363template uint32_t SymbolBody::template getVA<ELF32LE>(int64_t) const;
364template uint32_t SymbolBody::template getVA<ELF32BE>(int64_t) const;
365template uint64_t SymbolBody::template getVA<ELF64LE>(int64_t) const;
366template uint64_t SymbolBody::template getVA<ELF64BE>(int64_t) const;
Rui Ueyamab5a69702016-02-01 21:00:35367
368template uint32_t SymbolBody::template getGotVA<ELF32LE>() const;
369template uint32_t SymbolBody::template getGotVA<ELF32BE>() const;
370template uint64_t SymbolBody::template getGotVA<ELF64LE>() const;
371template uint64_t SymbolBody::template getGotVA<ELF64BE>() const;
372
Rafael Espindola74031ba2016-04-07 15:20:56373template uint32_t SymbolBody::template getGotOffset<ELF32LE>() const;
374template uint32_t SymbolBody::template getGotOffset<ELF32BE>() const;
375template uint64_t SymbolBody::template getGotOffset<ELF64LE>() const;
376template uint64_t SymbolBody::template getGotOffset<ELF64BE>() const;
377
Rui Ueyamab5a69702016-02-01 21:00:35378template uint32_t SymbolBody::template getGotPltVA<ELF32LE>() const;
379template uint32_t SymbolBody::template getGotPltVA<ELF32BE>() const;
380template uint64_t SymbolBody::template getGotPltVA<ELF64LE>() const;
381template uint64_t SymbolBody::template getGotPltVA<ELF64BE>() const;
382
Rafael Espindola74031ba2016-04-07 15:20:56383template uint32_t SymbolBody::template getGotPltOffset<ELF32LE>() const;
384template uint32_t SymbolBody::template getGotPltOffset<ELF32BE>() const;
385template uint64_t SymbolBody::template getGotPltOffset<ELF64LE>() const;
386template uint64_t SymbolBody::template getGotPltOffset<ELF64BE>() const;
387
Rui Ueyamab5a69702016-02-01 21:00:35388template uint32_t SymbolBody::template getPltVA<ELF32LE>() const;
389template uint32_t SymbolBody::template getPltVA<ELF32BE>() const;
390template uint64_t SymbolBody::template getPltVA<ELF64LE>() const;
391template uint64_t SymbolBody::template getPltVA<ELF64BE>() const;
392
Rui Ueyama512c61d2016-02-03 00:12:24393template uint32_t SymbolBody::template getSize<ELF32LE>() const;
394template uint32_t SymbolBody::template getSize<ELF32BE>() const;
395template uint64_t SymbolBody::template getSize<ELF64LE>() const;
396template uint64_t SymbolBody::template getSize<ELF64BE>() const;
397
Rui Ueyama968db482017-02-28 04:02:42398template const OutputSection *
399 SymbolBody::template getOutputSection<ELF32LE>() const;
400template const OutputSection *
401 SymbolBody::template getOutputSection<ELF32BE>() const;
402template const OutputSection *
403 SymbolBody::template getOutputSection<ELF64LE>() const;
404template const OutputSection *
405 SymbolBody::template getOutputSection<ELF64BE>() const;
406
Simon Atanasyanf967f092016-09-29 12:58:36407template class elf::DefinedRegular<ELF32LE>;
408template class elf::DefinedRegular<ELF32BE>;
409template class elf::DefinedRegular<ELF64LE>;
410template class elf::DefinedRegular<ELF64BE>;
Rui Ueyama4076fa12017-02-26 23:35:34411
412template uint64_t SharedSymbol::template getAlignment<ELF32LE>() const;
413template uint64_t SharedSymbol::template getAlignment<ELF32BE>() const;
414template uint64_t SharedSymbol::template getAlignment<ELF64LE>() const;
415template uint64_t SharedSymbol::template getAlignment<ELF64BE>() const;