blob: 29fa1120a19aef747e22376b8c22d5a931cf50c8 [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"
Michael J. Spencercdae0a42015-07-28 22:58:2511#include "InputFiles.h"
Rui Ueyamab5a69702016-02-01 21:00:3512#include "InputSection.h"
13#include "OutputSections.h"
Rui Ueyamaa3ac1732016-11-24 20:24:1814#include "Strings.h"
Rui Ueyamae8a61022016-11-05 23:05:4715#include "SyntheticSections.h"
Rui Ueyamab5a69702016-02-01 21:00:3516#include "Target.h"
Rafael Espindola17cb7c02016-12-19 17:01:0117#include "Writer.h"
Michael J. Spencer84487f12015-07-24 21:03:0718
Bob Haarmanb8a59c82017-10-25 22:28:3819#include "lld/Common/ErrorHandler.h"
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
George Rimare6c5d3862017-04-05 10:03:2531DefinedRegular *ElfSym::Bss;
Rui Ueyama3e1fc3f2017-04-13 21:37:5632DefinedRegular *ElfSym::Etext1;
Rafael Espindola5616adf2017-03-08 22:36:2833DefinedRegular *ElfSym::Etext2;
Rui Ueyama3e1fc3f2017-04-13 21:37:5634DefinedRegular *ElfSym::Edata1;
Rafael Espindola5616adf2017-03-08 22:36:2835DefinedRegular *ElfSym::Edata2;
Rui Ueyama3e1fc3f2017-04-13 21:37:5636DefinedRegular *ElfSym::End1;
Rafael Espindola5616adf2017-03-08 22:36:2837DefinedRegular *ElfSym::End2;
Rui Ueyama92c37812017-06-26 15:11:2438DefinedRegular *ElfSym::GlobalOffsetTable;
Rui Ueyama3e1fc3f2017-04-13 21:37:5639DefinedRegular *ElfSym::MipsGp;
Rui Ueyama80474a22017-02-28 19:29:5540DefinedRegular *ElfSym::MipsGpDisp;
41DefinedRegular *ElfSym::MipsLocalGp;
Rui Ueyama80474a22017-02-28 19:29:5542
Rui Ueyamaf52496e2017-11-03 21:21:4743static uint64_t getSymVA(const Symbol &Body, int64_t &Addend) {
Rafael Espindola87d9f102016-03-11 12:19:0544 switch (Body.kind()) {
Rui Ueyamaf52496e2017-11-03 21:21:4745 case Symbol::DefinedRegularKind: {
Rui Ueyama80474a22017-02-28 19:29:5546 auto &D = cast<DefinedRegular>(Body);
Rafael Espindola5616adf2017-03-08 22:36:2847 SectionBase *IS = D.Section;
48 if (auto *ISB = dyn_cast_or_null<InputSectionBase>(IS))
49 IS = ISB->Repl;
Rui Ueyamab5a69702016-02-01 21:00:3550
Rafael Espindolaccfe3cb2016-04-04 14:04:1651 // According to the ELF spec reference to a local symbol from outside
52 // the group are not allowed. Unfortunately .eh_frame breaks that rule
53 // and must be treated specially. For now we just replace the symbol with
54 // 0.
Rafael Espindola774ea7d2017-02-23 16:49:0755 if (IS == &InputSection::Discarded)
Rafael Espindolaccfe3cb2016-04-04 14:04:1656 return 0;
57
Rui Ueyamab5a69702016-02-01 21:00:3558 // This is an absolute symbol.
Sean Silva902ae3c2016-12-15 00:57:5359 if (!IS)
Rafael Espindolaccfe3cb2016-04-04 14:04:1660 return D.Value;
Rui Ueyamab5a69702016-02-01 21:00:3561
Rafael Espindola9371bab2017-03-08 15:21:3262 uint64_t Offset = D.Value;
Sean Silvaa9ba4502017-02-28 08:32:5663
64 // An object in an SHF_MERGE section might be referenced via a
65 // section symbol (as a hack for reducing the number of local
66 // symbols).
Sean Silvad4e60622017-03-01 04:44:0467 // Depending on the addend, the reference via a section symbol
68 // refers to a different object in the merge section.
69 // Since the objects in the merge section are not necessarily
70 // contiguous in the output, the addend can thus affect the final
71 // VA in a non-linear way.
72 // To make this work, we incorporate the addend into the section
73 // offset (and zero out the addend for later processing) so that
74 // we find the right object in the section.
Rafael Espindolaccfe3cb2016-04-04 14:04:1675 if (D.isSection()) {
Rafael Espindola1f5b70f2016-03-11 14:21:3776 Offset += Addend;
77 Addend = 0;
78 }
Sean Silvaa9ba4502017-02-28 08:32:5679
Rafael Espindola5e434b32017-03-08 16:08:3680 const OutputSection *OutSec = IS->getOutputSection();
Sean Silva6ab39262017-02-28 09:01:5881
82 // In the typical case, this is actually very simple and boils
83 // down to adding together 3 numbers:
84 // 1. The address of the output section.
85 // 2. The offset of the input section within the output section.
86 // 3. The offset within the input section (this addition happens
87 // inside InputSection::getOffset).
88 //
89 // If you understand the data structures involved with this next
90 // line (and how they get built), then you have a pretty good
91 // understanding of the linker.
Rafael Espindolae1294092017-03-08 16:03:4192 uint64_t VA = (OutSec ? OutSec->Addr : 0) + IS->getOffset(Offset);
Sean Silva6ab39262017-02-28 09:01:5893
George Rimar6a3b1542016-10-04 08:52:5194 if (D.isTls() && !Config->Relocatable) {
Rui Ueyama9d1bacb12017-02-27 02:31:2695 if (!Out::TlsPhdr)
Rafael Espindola6e93d052017-08-04 22:31:4296 fatal(toString(D.getFile()) +
Peter Collingbourne3e2abde2017-07-14 00:22:4697 " has an STT_TLS symbol but doesn't have an SHF_TLS section");
Rui Ueyama9d1bacb12017-02-27 02:31:2698 return VA - Out::TlsPhdr->p_vaddr;
George Rimar6a3b1542016-10-04 08:52:5199 }
Rafael Espindola1f5b70f2016-03-11 14:21:37100 return VA;
Rui Ueyamab5a69702016-02-01 21:00:35101 }
Rui Ueyamaf52496e2017-11-03 21:21:47102 case Symbol::DefinedCommonKind:
Ben Dunbobbin73eabf22017-09-29 09:08:26103 llvm_unreachable("common are converted to bss");
Rui Ueyamaf52496e2017-11-03 21:21:47104 case Symbol::SharedKind: {
Rui Ueyama007c0022017-03-08 17:24:24105 auto &SS = cast<SharedSymbol>(Body);
Rafael Espindola0afcef22017-08-04 17:43:54106 if (SS.CopyRelSec)
Rafael Espindolaf6c74c42017-09-13 16:59:12107 return SS.CopyRelSec->getParent()->Addr + SS.CopyRelSec->OutSecOff;
Rui Ueyama007c0022017-03-08 17:24:24108 if (SS.NeedsPltAddr)
George Rimarf64618a2017-03-17 11:56:54109 return Body.getPltVA();
Rui Ueyama924b3612017-02-16 06:12:22110 return 0;
Rui Ueyama007c0022017-03-08 17:24:24111 }
Rui Ueyamaf52496e2017-11-03 21:21:47112 case Symbol::UndefinedKind:
Rui Ueyamab5a69702016-02-01 21:00:35113 return 0;
Rui Ueyamaf52496e2017-11-03 21:21:47114 case Symbol::LazyArchiveKind:
115 case Symbol::LazyObjectKind:
Rui Ueyamaf1f00842017-10-31 16:07:41116 assert(Body.IsUsedInRegularObj && "lazy symbol reached writer");
Rui Ueyamab5a69702016-02-01 21:00:35117 return 0;
118 }
George Rimar777f9632016-03-12 08:31:34119 llvm_unreachable("invalid symbol kind");
Rui Ueyamab5a69702016-02-01 21:00:35120}
121
Rui Ueyamace2f5fd2017-10-13 02:57:59122// Returns true if this is a weak undefined symbol.
Rui Ueyamaf52496e2017-11-03 21:21:47123bool Symbol::isUndefWeak() const {
Rafael Espindola9c8f8532017-10-24 16:27:31124 // See comment on Lazy in Symbols.h for the details.
Rui Ueyamaf1f00842017-10-31 16:07:41125 return !isLocal() && isWeak() && (isUndefined() || isLazy());
Rafael Espindola3d9f1c02017-09-13 20:43:04126}
127
Rui Ueyamaf52496e2017-11-03 21:21:47128InputFile *Symbol::getFile() const {
Rafael Espindoladb1af692017-08-11 17:47:12129 if (isLocal()) {
130 const SectionBase *Sec = cast<DefinedRegular>(this)->Section;
131 // Local absolute symbols actually have a file, but that is not currently
132 // used. We could support that by having a mostly redundant InputFile in
Rui Ueyamaf52496e2017-11-03 21:21:47133 // Symbol, or having a special absolute section if needed.
Rafael Espindoladb1af692017-08-11 17:47:12134 return Sec ? cast<InputSectionBase>(Sec)->File : nullptr;
135 }
Rui Ueyamaf1f00842017-10-31 16:07:41136 return File;
Rafael Espindola6e93d052017-08-04 22:31:42137}
138
Rafael Espindolacf00d432017-07-05 00:43:18139// Overwrites all attributes with Other's so that this symbol becomes
140// an alias to Other. This is useful for handling some options such as
141// --wrap.
Rui Ueyamaf52496e2017-11-03 21:21:47142void Symbol::copyFrom(Symbol *Other) {
143 Symbol Sym = *this;
Rui Ueyamaf1f00842017-10-31 16:07:41144 memcpy(this, Other, sizeof(SymbolUnion));
145
146 Binding = Sym.Binding;
147 VersionId = Sym.VersionId;
148 Visibility = Sym.Visibility;
149 IsUsedInRegularObj = Sym.IsUsedInRegularObj;
150 ExportDynamic = Sym.ExportDynamic;
151 CanInline = Sym.CanInline;
152 Traced = Sym.Traced;
153 InVersionScript = Sym.InVersionScript;
Rui Ueyamab2269ec2017-06-28 19:43:02154}
155
Rui Ueyamaf52496e2017-11-03 21:21:47156uint64_t Symbol::getVA(int64_t Addend) const {
George Rimarf64618a2017-03-17 11:56:54157 uint64_t OutVA = getSymVA(*this, Addend);
Rafael Espindola8381c562016-03-17 23:36:19158 return OutVA + Addend;
Rafael Espindola87d9f102016-03-11 12:19:05159}
160
Rui Ueyamaf52496e2017-11-03 21:21:47161uint64_t Symbol::getGotVA() const { return InX::Got->getVA() + getGotOffset(); }
Rafael Espindola74031ba2016-04-07 15:20:56162
Rui Ueyamaf52496e2017-11-03 21:21:47163uint64_t Symbol::getGotOffset() const {
Rui Ueyama803b1202016-07-13 18:55:14164 return GotIndex * Target->GotEntrySize;
Rui Ueyamab5a69702016-02-01 21:00:35165}
166
Rui Ueyamaf52496e2017-11-03 21:21:47167uint64_t Symbol::getGotPltVA() const {
Peter Smithbaffdb82016-12-08 12:58:55168 if (this->IsInIgot)
George Rimar4670bb02017-03-16 12:58:11169 return InX::IgotPlt->getVA() + getGotPltOffset();
170 return InX::GotPlt->getVA() + getGotPltOffset();
Rafael Espindola74031ba2016-04-07 15:20:56171}
172
Rui Ueyamaf52496e2017-11-03 21:21:47173uint64_t Symbol::getGotPltOffset() const {
Rui Ueyama803b1202016-07-13 18:55:14174 return GotPltIndex * Target->GotPltEntrySize;
Rui Ueyamab5a69702016-02-01 21:00:35175}
176
Rui Ueyamaf52496e2017-11-03 21:21:47177uint64_t Symbol::getPltVA() const {
Peter Smithbaffdb82016-12-08 12:58:55178 if (this->IsInIplt)
George Rimarf64618a2017-03-17 11:56:54179 return InX::Iplt->getVA() + PltIndex * Target->PltEntrySize;
180 return InX::Plt->getVA() + Target->PltHeaderSize +
Rui Ueyamab5a69702016-02-01 21:00:35181 PltIndex * Target->PltEntrySize;
182}
183
Rui Ueyamaf52496e2017-11-03 21:21:47184uint64_t Symbol::getSize() const {
Rafael Espindolae7553e42016-08-31 13:28:33185 if (const auto *C = dyn_cast<DefinedCommon>(this))
Rafael Espindolaccfe3cb2016-04-04 14:04:16186 return C->Size;
Rui Ueyama80474a22017-02-28 19:29:55187 if (const auto *DR = dyn_cast<DefinedRegular>(this))
Rafael Espindolaccfe3cb2016-04-04 14:04:16188 return DR->Size;
Rui Ueyama4076fa12017-02-26 23:35:34189 if (const auto *S = dyn_cast<SharedSymbol>(this))
Rui Ueyama7f9694a42017-10-28 20:15:56190 return S->Size;
Rui Ueyama512c61d2016-02-03 00:12:24191 return 0;
192}
193
Rui Ueyamaf52496e2017-11-03 21:21:47194OutputSection *Symbol::getOutputSection() const {
Rui Ueyama80474a22017-02-28 19:29:55195 if (auto *S = dyn_cast<DefinedRegular>(this)) {
Rui Ueyama968db482017-02-28 04:02:42196 if (S->Section)
Rafael Espindola5e434b32017-03-08 16:08:36197 return S->Section->getOutputSection();
Rui Ueyama968db482017-02-28 04:02:42198 return nullptr;
199 }
200
Rui Ueyama007c0022017-03-08 17:24:24201 if (auto *S = dyn_cast<SharedSymbol>(this)) {
Rafael Espindola0afcef22017-08-04 17:43:54202 if (S->CopyRelSec)
Rafael Espindoladb5e56f2017-05-31 20:17:44203 return S->CopyRelSec->getParent();
Rui Ueyama968db482017-02-28 04:02:42204 return nullptr;
Rui Ueyama007c0022017-03-08 17:24:24205 }
Rui Ueyama968db482017-02-28 04:02:42206
Dmitry Mikulin1e30f072017-09-08 16:22:43207 if (auto *S = dyn_cast<DefinedCommon>(this)) {
Rui Ueyama968db482017-02-28 04:02:42208 if (Config->DefineCommon)
Dmitry Mikulin1e30f072017-09-08 16:22:43209 return S->Section->getParent();
Rui Ueyama968db482017-02-28 04:02:42210 return nullptr;
211 }
212
Rui Ueyama968db482017-02-28 04:02:42213 return nullptr;
214}
215
Rui Ueyama35fa6c52016-11-23 05:48:40216// If a symbol name contains '@', the characters after that is
217// a symbol version name. This function parses that.
Rui Ueyamaf52496e2017-11-03 21:21:47218void Symbol::parseSymbolVersion() {
Rui Ueyama35fa6c52016-11-23 05:48:40219 StringRef S = getName();
220 size_t Pos = S.find('@');
221 if (Pos == 0 || Pos == StringRef::npos)
222 return;
223 StringRef Verstr = S.substr(Pos + 1);
224 if (Verstr.empty())
225 return;
226
227 // Truncate the symbol name so that it doesn't include the version string.
Rui Ueyamaa13efc22016-11-29 18:05:04228 Name = {S.data(), Pos};
Rui Ueyama35fa6c52016-11-23 05:48:40229
Rafael Espindola1d6d1b42017-01-17 16:08:06230 // If this is not in this DSO, it is not a definition.
Rui Ueyamabda337a2017-10-27 22:54:16231 if (!isInCurrentOutput())
Rafael Espindola2756e042017-01-06 22:30:35232 return;
233
Rui Ueyama35fa6c52016-11-23 05:48:40234 // '@@' in a symbol name means the default version.
235 // It is usually the most recent one.
236 bool IsDefault = (Verstr[0] == '@');
237 if (IsDefault)
238 Verstr = Verstr.substr(1);
239
240 for (VersionDefinition &Ver : Config->VersionDefinitions) {
241 if (Ver.Name != Verstr)
242 continue;
243
244 if (IsDefault)
Rui Ueyamaf1f00842017-10-31 16:07:41245 VersionId = Ver.Id;
Rui Ueyama35fa6c52016-11-23 05:48:40246 else
Rui Ueyamaf1f00842017-10-31 16:07:41247 VersionId = Ver.Id | VERSYM_HIDDEN;
Rui Ueyama35fa6c52016-11-23 05:48:40248 return;
249 }
250
251 // It is an error if the specified version is not defined.
George Rimar4d2f97622017-07-04 13:19:13252 // Usually version script is not provided when linking executable,
253 // but we may still want to override a versioned symbol from DSO,
254 // so we do not report error in this case.
255 if (Config->Shared)
Rafael Espindola6e93d052017-08-04 22:31:42256 error(toString(getFile()) + ": symbol " + S + " has undefined version " +
George Rimar4d2f97622017-07-04 13:19:13257 Verstr);
Rui Ueyama35fa6c52016-11-23 05:48:40258}
259
Rui Ueyama80474a22017-02-28 19:29:55260template <class ELFT> bool DefinedRegular::isMipsPIC() const {
Rui Ueyamad97265f2017-06-09 21:09:08261 typedef typename ELFT::Ehdr Elf_Ehdr;
Simon Atanasyanf967f092016-09-29 12:58:36262 if (!Section || !isFunc())
263 return false;
Rui Ueyamad97265f2017-06-09 21:09:08264
265 auto *Sec = cast<InputSectionBase>(Section);
266 const Elf_Ehdr *Hdr = Sec->template getFile<ELFT>()->getObj().getHeader();
Simon Atanasyanf967f092016-09-29 12:58:36267 return (this->StOther & STO_MIPS_MIPS16) == STO_MIPS_PIC ||
Rui Ueyamad97265f2017-06-09 21:09:08268 (Hdr->e_flags & EF_MIPS_PIC);
Simon Atanasyanf967f092016-09-29 12:58:36269}
270
Rui Ueyama55518e72016-10-28 20:57:25271InputFile *Lazy::fetch() {
Rui Ueyamaf8baa662016-04-07 19:24:51272 if (auto *S = dyn_cast<LazyArchive>(this))
Rui Ueyama55518e72016-10-28 20:57:25273 return S->fetch();
274 return cast<LazyObject>(this)->fetch();
Rui Ueyamaf8baa662016-04-07 19:24:51275}
276
Rafael Espindola6e93d052017-08-04 22:31:42277ArchiveFile *LazyArchive::getFile() {
Rui Ueyamaf52496e2017-11-03 21:21:47278 return cast<ArchiveFile>(Symbol::getFile());
Rui Ueyama434b5612016-07-17 03:11:46279}
280
Rui Ueyama55518e72016-10-28 20:57:25281InputFile *LazyArchive::fetch() {
Rafael Espindola6e93d052017-08-04 22:31:42282 std::pair<MemoryBufferRef, uint64_t> MBInfo = getFile()->getMember(&Sym);
Michael J. Spencer1b348a62015-09-04 22:28:10283
284 // getMember returns an empty buffer if the member was already
285 // read from the library.
Davide Italianobcdd6c62016-10-12 19:35:54286 if (MBInfo.first.getBuffer().empty())
Rui Ueyama38dbd3e2016-09-14 00:05:51287 return nullptr;
Rafael Espindola6e93d052017-08-04 22:31:42288 return createObjectFile(MBInfo.first, getFile()->getName(), MBInfo.second);
Michael J. Spencer1b348a62015-09-04 22:28:10289}
290
Rafael Espindola6e93d052017-08-04 22:31:42291LazyObjFile *LazyObject::getFile() {
Rui Ueyamaf52496e2017-11-03 21:21:47292 return cast<LazyObjFile>(Symbol::getFile());
Rafael Espindola6e93d052017-08-04 22:31:42293}
294
295InputFile *LazyObject::fetch() { return getFile()->fetch(); }
Rui Ueyamaf8baa662016-04-07 19:24:51296
Rui Ueyamaf52496e2017-11-03 21:21:47297uint8_t Symbol::computeBinding() const {
Rafael Espindolab7e2ee22017-01-10 17:08:13298 if (Config->Relocatable)
299 return Binding;
Peter Collingbournedadcc172016-04-22 18:42:48300 if (Visibility != STV_DEFAULT && Visibility != STV_PROTECTED)
Rafael Espindolab7e2ee22017-01-10 17:08:13301 return STB_LOCAL;
Rui Ueyamaf1f00842017-10-31 16:07:41302 if (VersionId == VER_NDX_LOCAL && isInCurrentOutput())
Rafael Espindolab7e2ee22017-01-10 17:08:13303 return STB_LOCAL;
304 if (Config->NoGnuUnique && Binding == STB_GNU_UNIQUE)
305 return STB_GLOBAL;
306 return Binding;
307}
308
Rui Ueyamaf52496e2017-11-03 21:21:47309bool Symbol::includeInDynsym() const {
Rafael Espindolae05e2f82017-09-15 18:05:02310 if (!Config->HasDynSymTab)
311 return false;
Rafael Espindolab7e2ee22017-01-10 17:08:13312 if (computeBinding() == STB_LOCAL)
Rafael Espindolaae605c12016-04-21 20:35:25313 return false;
Rui Ueyamaf1f00842017-10-31 16:07:41314 if (!isInCurrentOutput())
Rafael Espindola3d9f1c02017-09-13 20:43:04315 return true;
Rafael Espindolac57f8cd2017-09-13 20:47:53316 return ExportDynamic;
Rafael Espindolaae605c12016-04-21 20:35:25317}
Rui Ueyama69c778c2016-07-17 17:50:09318
319// Print out a log message for --trace-symbol.
Rui Ueyamaf52496e2017-11-03 21:21:47320void elf::printTraceSymbol(Symbol *Sym) {
Rui Ueyamae6e206d2017-02-21 23:22:56321 std::string S;
Rui Ueyamaf1f00842017-10-31 16:07:41322 if (Sym->isUndefined())
Rui Ueyamae6e206d2017-02-21 23:22:56323 S = ": reference to ";
Rui Ueyamaf1f00842017-10-31 16:07:41324 else if (Sym->isCommon())
Rui Ueyamae6e206d2017-02-21 23:22:56325 S = ": common definition of ";
Rui Ueyamaf1f00842017-10-31 16:07:41326 else if (Sym->isLazy())
Rafael Espindolabc2b1652017-10-27 18:30:11327 S = ": lazy definition of ";
Rui Ueyamaf1f00842017-10-31 16:07:41328 else if (Sym->isShared())
Rafael Espindolabc2b1652017-10-27 18:30:11329 S = ": shared definition of ";
Rui Ueyama69c778c2016-07-17 17:50:09330 else
Rui Ueyamae6e206d2017-02-21 23:22:56331 S = ": definition of ";
332
Rui Ueyamaf1f00842017-10-31 16:07:41333 message(toString(Sym->File) + S + Sym->getName());
Rui Ueyama69c778c2016-07-17 17:50:09334}
335
Rui Ueyamaa3ac1732016-11-24 20:24:18336// Returns a symbol for an error message.
Rui Ueyamaf52496e2017-11-03 21:21:47337std::string lld::toString(const Symbol &B) {
Rui Ueyamaa3ac1732016-11-24 20:24:18338 if (Config->Demangle)
Rui Ueyama4c5b8ce2016-12-07 23:17:05339 if (Optional<std::string> S = demangle(B.getName()))
340 return *S;
Rui Ueyamaa3ac1732016-11-24 20:24:18341 return B.getName();
342}
343
Rui Ueyama80474a22017-02-28 19:29:55344template bool DefinedRegular::template isMipsPIC<ELF32LE>() const;
345template bool DefinedRegular::template isMipsPIC<ELF32BE>() const;
346template bool DefinedRegular::template isMipsPIC<ELF64LE>() const;
347template bool DefinedRegular::template isMipsPIC<ELF64BE>() const;