Rafael Espindola | 5805c4f | 2015-09-21 21:38:08 +0000 | [diff] [blame] | 1 | //===- OutputSections.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 "OutputSections.h" |
| 11 | #include "Config.h" |
Rafael Espindola | 5805c4f | 2015-09-21 21:38:08 +0000 | [diff] [blame] | 12 | #include "SymbolTable.h" |
| 13 | |
Rafael Espindola | 5805c4f | 2015-09-21 21:38:08 +0000 | [diff] [blame] | 14 | using namespace llvm; |
| 15 | using namespace llvm::object; |
| 16 | using namespace llvm::ELF; |
| 17 | |
| 18 | using namespace lld; |
| 19 | using namespace lld::elf2; |
| 20 | |
| 21 | template <bool Is64Bits> |
| 22 | OutputSectionBase<Is64Bits>::OutputSectionBase(StringRef Name, uint32_t sh_type, |
| 23 | uintX_t sh_flags) |
| 24 | : Name(Name) { |
| 25 | memset(&Header, 0, sizeof(HeaderT)); |
| 26 | Header.sh_type = sh_type; |
| 27 | Header.sh_flags = sh_flags; |
| 28 | } |
| 29 | |
| 30 | template <class ELFT> void GotSection<ELFT>::addEntry(SymbolBody *Sym) { |
| 31 | Sym->setGotIndex(Entries.size()); |
| 32 | Entries.push_back(Sym); |
| 33 | } |
| 34 | |
| 35 | template <class ELFT> |
| 36 | typename GotSection<ELFT>::uintX_t |
| 37 | GotSection<ELFT>::getEntryAddr(const SymbolBody &B) const { |
| 38 | return this->getVA() + B.getGotIndex() * this->getAddrSize(); |
| 39 | } |
| 40 | |
| 41 | template <class ELFT> void PltSection<ELFT>::writeTo(uint8_t *Buf) { |
| 42 | uintptr_t Start = reinterpret_cast<uintptr_t>(Buf); |
| 43 | ArrayRef<uint8_t> Jmp = {0xff, 0x25}; // jmpq *val(%rip) |
| 44 | for (const SymbolBody *E : Entries) { |
| 45 | uintptr_t InstPos = reinterpret_cast<uintptr_t>(Buf); |
| 46 | |
| 47 | memcpy(Buf, Jmp.data(), Jmp.size()); |
| 48 | Buf += Jmp.size(); |
| 49 | |
| 50 | uintptr_t OffsetInPLT = (InstPos + 6) - Start; |
Rafael Espindola | 454ca1c | 2015-09-22 17:08:25 +0000 | [diff] [blame] | 51 | intptr_t Delta = GotSec.getEntryAddr(*E) - (this->getVA() + OffsetInPLT); |
Rafael Espindola | 5805c4f | 2015-09-21 21:38:08 +0000 | [diff] [blame] | 52 | assert(isInt<32>(Delta)); |
| 53 | support::endian::write32le(Buf, Delta); |
| 54 | Buf += 4; |
| 55 | |
| 56 | *Buf = 0x90; // nop |
| 57 | ++Buf; |
| 58 | *Buf = 0x90; // nop |
| 59 | ++Buf; |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | template <class ELFT> void PltSection<ELFT>::addEntry(SymbolBody *Sym) { |
| 64 | Sym->setPltIndex(Entries.size()); |
| 65 | Entries.push_back(Sym); |
| 66 | } |
| 67 | |
| 68 | template <class ELFT> |
| 69 | typename PltSection<ELFT>::uintX_t |
| 70 | PltSection<ELFT>::getEntryAddr(const SymbolBody &B) const { |
| 71 | return this->getVA() + B.getPltIndex() * EntrySize; |
| 72 | } |
| 73 | |
| 74 | bool lld::elf2::relocNeedsPLT(uint32_t Type) { |
| 75 | switch (Type) { |
| 76 | default: |
| 77 | return false; |
| 78 | case R_X86_64_PLT32: |
| 79 | return true; |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | bool lld::elf2::relocNeedsGOT(uint32_t Type) { |
| 84 | if (relocNeedsPLT(Type)) |
| 85 | return true; |
| 86 | switch (Type) { |
| 87 | default: |
| 88 | return false; |
| 89 | case R_X86_64_GOTPCREL: |
| 90 | return true; |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | template <class ELFT> void RelocationSection<ELFT>::writeTo(uint8_t *Buf) { |
Rafael Espindola | 50534c2 | 2015-09-22 17:49:38 +0000 | [diff] [blame^] | 95 | const unsigned EntrySize = IsRela ? sizeof(Elf_Rela) : sizeof(Elf_Rel); |
Rafael Espindola | 5805c4f | 2015-09-21 21:38:08 +0000 | [diff] [blame] | 96 | bool IsMips64EL = Relocs[0].C.getFile()->getObj()->isMips64EL(); |
| 97 | for (const DynamicReloc<ELFT> &Rel : Relocs) { |
Rafael Espindola | 50534c2 | 2015-09-22 17:49:38 +0000 | [diff] [blame^] | 98 | auto *P = reinterpret_cast<Elf_Rel *>(Buf); |
| 99 | Buf += EntrySize; |
| 100 | |
Rafael Espindola | 5805c4f | 2015-09-21 21:38:08 +0000 | [diff] [blame] | 101 | const InputSection<ELFT> &C = Rel.C; |
| 102 | const Elf_Rel &RI = Rel.RI; |
| 103 | OutputSection<ELFT> *Out = C.getOutputSection(); |
| 104 | uint32_t SymIndex = RI.getSymbol(IsMips64EL); |
| 105 | const SymbolBody *Body = C.getFile()->getSymbolBody(SymIndex); |
| 106 | uint32_t Type = RI.getType(IsMips64EL); |
| 107 | if (relocNeedsGOT(Type)) { |
| 108 | P->r_offset = GotSec.getEntryAddr(*Body); |
| 109 | P->setSymbolAndType(Body->getDynamicSymbolTableIndex(), R_X86_64_GLOB_DAT, |
| 110 | IsMips64EL); |
| 111 | } else { |
| 112 | P->r_offset = RI.r_offset + C.getOutputSectionOff() + Out->getVA(); |
| 113 | P->setSymbolAndType(Body->getDynamicSymbolTableIndex(), Type, IsMips64EL); |
| 114 | if (IsRela) |
Rafael Espindola | 50534c2 | 2015-09-22 17:49:38 +0000 | [diff] [blame^] | 115 | static_cast<Elf_Rela *>(P)->r_addend = |
| 116 | static_cast<const Elf_Rela &>(RI).r_addend; |
Rafael Espindola | 5805c4f | 2015-09-21 21:38:08 +0000 | [diff] [blame] | 117 | } |
Rafael Espindola | 5805c4f | 2015-09-21 21:38:08 +0000 | [diff] [blame] | 118 | } |
| 119 | } |
| 120 | |
| 121 | template <class ELFT> void RelocationSection<ELFT>::finalize() { |
| 122 | this->Header.sh_link = DynSymSec.getSectionIndex(); |
| 123 | this->Header.sh_size = Relocs.size() * this->Header.sh_entsize; |
| 124 | } |
| 125 | |
| 126 | template <bool Is64Bits> |
| 127 | InterpSection<Is64Bits>::InterpSection() |
| 128 | : OutputSectionBase<Is64Bits>(".interp", llvm::ELF::SHT_PROGBITS, |
| 129 | llvm::ELF::SHF_ALLOC) { |
| 130 | this->Header.sh_size = Config->DynamicLinker.size() + 1; |
| 131 | this->Header.sh_addralign = 1; |
| 132 | } |
| 133 | |
| 134 | template <bool Is64Bits> |
| 135 | template <endianness E> |
| 136 | void OutputSectionBase<Is64Bits>::writeHeaderTo( |
| 137 | typename ELFFile<ELFType<E, Is64Bits>>::Elf_Shdr *SHdr) { |
| 138 | SHdr->sh_name = Header.sh_name; |
| 139 | SHdr->sh_type = Header.sh_type; |
| 140 | SHdr->sh_flags = Header.sh_flags; |
| 141 | SHdr->sh_addr = Header.sh_addr; |
| 142 | SHdr->sh_offset = Header.sh_offset; |
| 143 | SHdr->sh_size = Header.sh_size; |
| 144 | SHdr->sh_link = Header.sh_link; |
| 145 | SHdr->sh_info = Header.sh_info; |
| 146 | SHdr->sh_addralign = Header.sh_addralign; |
| 147 | SHdr->sh_entsize = Header.sh_entsize; |
| 148 | } |
| 149 | |
| 150 | template <bool Is64Bits> void InterpSection<Is64Bits>::writeTo(uint8_t *Buf) { |
| 151 | memcpy(Buf, Config->DynamicLinker.data(), Config->DynamicLinker.size()); |
| 152 | } |
| 153 | |
| 154 | template <class ELFT> void HashTableSection<ELFT>::addSymbol(SymbolBody *S) { |
| 155 | StringRef Name = S->getName(); |
| 156 | DynSymSec.addSymbol(Name); |
| 157 | Hashes.push_back(hash(Name)); |
| 158 | S->setDynamicSymbolTableIndex(Hashes.size()); |
| 159 | } |
| 160 | |
| 161 | template <class ELFT> void DynamicSection<ELFT>::finalize() { |
| 162 | typename Base::HeaderT &Header = this->Header; |
| 163 | Header.sh_link = DynStrSec.getSectionIndex(); |
| 164 | |
| 165 | unsigned NumEntries = 0; |
| 166 | if (RelaDynSec.hasRelocs()) { |
| 167 | ++NumEntries; // DT_RELA / DT_REL |
| 168 | ++NumEntries; // DT_RELASZ / DTRELSZ |
| 169 | } |
| 170 | ++NumEntries; // DT_SYMTAB |
| 171 | ++NumEntries; // DT_STRTAB |
| 172 | ++NumEntries; // DT_STRSZ |
| 173 | ++NumEntries; // DT_HASH |
| 174 | |
| 175 | StringRef RPath = Config->RPath; |
| 176 | if (!RPath.empty()) { |
| 177 | ++NumEntries; // DT_RUNPATH |
| 178 | DynStrSec.add(RPath); |
| 179 | } |
| 180 | |
| 181 | const std::vector<std::unique_ptr<SharedFileBase>> &SharedFiles = |
| 182 | SymTab.getSharedFiles(); |
| 183 | for (const std::unique_ptr<SharedFileBase> &File : SharedFiles) |
| 184 | DynStrSec.add(File->getName()); |
| 185 | NumEntries += SharedFiles.size(); |
| 186 | |
| 187 | ++NumEntries; // DT_NULL |
| 188 | |
| 189 | Header.sh_size = NumEntries * Header.sh_entsize; |
| 190 | } |
| 191 | |
| 192 | template <class ELFT> void DynamicSection<ELFT>::writeTo(uint8_t *Buf) { |
| 193 | typedef typename std::conditional<ELFT::Is64Bits, Elf64_Dyn, Elf32_Dyn>::type |
| 194 | Elf_Dyn; |
| 195 | auto *P = reinterpret_cast<Elf_Dyn *>(Buf); |
| 196 | |
| 197 | if (RelaDynSec.hasRelocs()) { |
| 198 | bool IsRela = RelaDynSec.isRela(); |
| 199 | P->d_tag = IsRela ? DT_RELA : DT_REL; |
| 200 | P->d_un.d_ptr = RelaDynSec.getVA(); |
| 201 | ++P; |
| 202 | |
| 203 | P->d_tag = IsRela ? DT_RELASZ : DT_RELSZ; |
| 204 | P->d_un.d_val = RelaDynSec.getSize(); |
| 205 | ++P; |
| 206 | } |
| 207 | |
| 208 | P->d_tag = DT_SYMTAB; |
| 209 | P->d_un.d_ptr = DynSymSec.getVA(); |
| 210 | ++P; |
| 211 | |
| 212 | P->d_tag = DT_STRTAB; |
| 213 | P->d_un.d_ptr = DynStrSec.getVA(); |
| 214 | ++P; |
| 215 | |
| 216 | P->d_tag = DT_STRSZ; |
| 217 | P->d_un.d_val = DynStrSec.data().size(); |
| 218 | ++P; |
| 219 | |
| 220 | P->d_tag = DT_HASH; |
| 221 | P->d_un.d_ptr = HashSec.getVA(); |
| 222 | ++P; |
| 223 | |
| 224 | StringRef RPath = Config->RPath; |
| 225 | if (!RPath.empty()) { |
| 226 | P->d_tag = DT_RUNPATH; |
| 227 | P->d_un.d_val = DynStrSec.getFileOff(RPath); |
| 228 | ++P; |
| 229 | } |
| 230 | |
| 231 | const std::vector<std::unique_ptr<SharedFileBase>> &SharedFiles = |
| 232 | SymTab.getSharedFiles(); |
| 233 | for (const std::unique_ptr<SharedFileBase> &File : SharedFiles) { |
| 234 | P->d_tag = DT_NEEDED; |
| 235 | P->d_un.d_val = DynStrSec.getFileOff(File->getName()); |
| 236 | ++P; |
| 237 | } |
| 238 | |
| 239 | P->d_tag = DT_NULL; |
| 240 | P->d_un.d_val = 0; |
| 241 | ++P; |
| 242 | } |
| 243 | |
| 244 | template <class ELFT> |
Rafael Espindola | 7167585 | 2015-09-22 00:16:19 +0000 | [diff] [blame] | 245 | void OutputSection<ELFT>::addSection(InputSection<ELFT> *C) { |
| 246 | Sections.push_back(C); |
Rafael Espindola | 5805c4f | 2015-09-21 21:38:08 +0000 | [diff] [blame] | 247 | C->setOutputSection(this); |
| 248 | uint32_t Align = C->getAlign(); |
| 249 | if (Align > this->Header.sh_addralign) |
| 250 | this->Header.sh_addralign = Align; |
| 251 | |
| 252 | uintX_t Off = this->Header.sh_size; |
| 253 | Off = RoundUpToAlignment(Off, Align); |
| 254 | C->setOutputSectionOff(Off); |
| 255 | Off += C->getSize(); |
| 256 | this->Header.sh_size = Off; |
| 257 | } |
| 258 | |
| 259 | template <class ELFT> |
Rafael Espindola | 5805c4f | 2015-09-21 21:38:08 +0000 | [diff] [blame] | 260 | typename ELFFile<ELFT>::uintX_t |
| 261 | lld::elf2::getSymVA(const DefinedRegular<ELFT> *DR) { |
| 262 | const InputSection<ELFT> *SC = &DR->Section; |
| 263 | OutputSection<ELFT> *OS = SC->getOutputSection(); |
| 264 | return OS->getVA() + SC->getOutputSectionOff() + DR->Sym.st_value; |
| 265 | } |
| 266 | |
| 267 | template <class ELFT> |
| 268 | typename ELFFile<ELFT>::uintX_t |
| 269 | lld::elf2::getLocalSymVA(const typename ELFFile<ELFT>::Elf_Sym *Sym, |
| 270 | const ObjectFile<ELFT> &File) { |
| 271 | uint32_t SecIndex = Sym->st_shndx; |
| 272 | |
| 273 | if (SecIndex == SHN_XINDEX) |
| 274 | SecIndex = File.getObj()->getExtendedSymbolTableIndex( |
| 275 | Sym, File.getSymbolTable(), File.getSymbolTableShndx()); |
Rafael Espindola | 7167585 | 2015-09-22 00:16:19 +0000 | [diff] [blame] | 276 | ArrayRef<InputSection<ELFT> *> Sections = File.getSections(); |
| 277 | InputSection<ELFT> *Section = Sections[SecIndex]; |
Rafael Espindola | 5805c4f | 2015-09-21 21:38:08 +0000 | [diff] [blame] | 278 | OutputSection<ELFT> *Out = Section->getOutputSection(); |
| 279 | return Out->getVA() + Section->getOutputSectionOff() + Sym->st_value; |
| 280 | } |
| 281 | |
Rafael Espindola | 5805c4f | 2015-09-21 21:38:08 +0000 | [diff] [blame] | 282 | template <class ELFT> void OutputSection<ELFT>::writeTo(uint8_t *Buf) { |
Rafael Espindola | 7167585 | 2015-09-22 00:16:19 +0000 | [diff] [blame] | 283 | for (InputSection<ELFT> *C : Sections) |
Rafael Espindola | 4ea0021 | 2015-09-21 22:01:00 +0000 | [diff] [blame] | 284 | C->writeTo(Buf, PltSec, GotSec); |
Rafael Espindola | 5805c4f | 2015-09-21 21:38:08 +0000 | [diff] [blame] | 285 | } |
| 286 | |
| 287 | template <bool Is64Bits> |
| 288 | void StringTableSection<Is64Bits>::writeTo(uint8_t *Buf) { |
| 289 | StringRef Data = StrTabBuilder.data(); |
| 290 | memcpy(Buf, Data.data(), Data.size()); |
| 291 | } |
| 292 | |
| 293 | bool lld::elf2::includeInSymtab(const SymbolBody &B) { |
| 294 | if (B.isLazy()) |
| 295 | return false; |
| 296 | if (!B.isUsedInRegularObj()) |
| 297 | return false; |
| 298 | uint8_t V = B.getMostConstrainingVisibility(); |
| 299 | if (V != STV_DEFAULT && V != STV_PROTECTED) |
| 300 | return false; |
| 301 | return true; |
| 302 | } |
| 303 | |
| 304 | template <class ELFT> void SymbolTableSection<ELFT>::writeTo(uint8_t *Buf) { |
| 305 | const OutputSection<ELFT> *Out = nullptr; |
| 306 | const InputSection<ELFT> *Section = nullptr; |
| 307 | Buf += sizeof(Elf_Sym); |
| 308 | |
| 309 | // All symbols with STB_LOCAL binding precede the weak and global symbols. |
| 310 | // .dynsym only contains global symbols. |
| 311 | if (!Config->DiscardAll && !StrTabSec.isDynamic()) { |
| 312 | for (const std::unique_ptr<ObjectFileBase> &FileB : |
| 313 | Table.getObjectFiles()) { |
| 314 | auto &File = cast<ObjectFile<ELFT>>(*FileB); |
| 315 | Elf_Sym_Range Syms = File.getLocalSymbols(); |
| 316 | for (const Elf_Sym &Sym : Syms) { |
| 317 | auto *ESym = reinterpret_cast<Elf_Sym *>(Buf); |
| 318 | uint32_t SecIndex = Sym.st_shndx; |
| 319 | ErrorOr<StringRef> SymName = Sym.getName(File.getStringTable()); |
| 320 | if (Config->DiscardLocals && SymName->startswith(".L")) |
| 321 | continue; |
| 322 | ESym->st_name = (SymName) ? StrTabSec.getFileOff(*SymName) : 0; |
| 323 | ESym->st_size = Sym.st_size; |
| 324 | ESym->setBindingAndType(Sym.getBinding(), Sym.getType()); |
| 325 | if (SecIndex == SHN_XINDEX) |
| 326 | SecIndex = File.getObj()->getExtendedSymbolTableIndex( |
| 327 | &Sym, File.getSymbolTable(), File.getSymbolTableShndx()); |
Rafael Espindola | 7167585 | 2015-09-22 00:16:19 +0000 | [diff] [blame] | 328 | ArrayRef<InputSection<ELFT> *> Sections = File.getSections(); |
| 329 | Section = Sections[SecIndex]; |
Rafael Espindola | 5805c4f | 2015-09-21 21:38:08 +0000 | [diff] [blame] | 330 | assert(Section != nullptr); |
| 331 | Out = Section->getOutputSection(); |
| 332 | assert(Out != nullptr); |
| 333 | ESym->st_shndx = Out->getSectionIndex(); |
| 334 | ESym->st_value = |
| 335 | Out->getVA() + Section->getOutputSectionOff() + Sym.st_value; |
| 336 | Buf += sizeof(Elf_Sym); |
| 337 | } |
| 338 | } |
| 339 | } |
| 340 | |
| 341 | for (auto &P : Table.getSymbols()) { |
| 342 | StringRef Name = P.first; |
| 343 | Symbol *Sym = P.second; |
| 344 | SymbolBody *Body = Sym->Body; |
| 345 | if (!includeInSymtab(*Body)) |
| 346 | continue; |
| 347 | const Elf_Sym &InputSym = cast<ELFSymbolBody<ELFT>>(Body)->Sym; |
| 348 | |
| 349 | auto *ESym = reinterpret_cast<Elf_Sym *>(Buf); |
| 350 | ESym->st_name = StrTabSec.getFileOff(Name); |
| 351 | |
| 352 | Out = nullptr; |
| 353 | Section = nullptr; |
| 354 | |
| 355 | switch (Body->kind()) { |
| 356 | case SymbolBody::DefinedRegularKind: |
| 357 | Section = &cast<DefinedRegular<ELFT>>(Body)->Section; |
| 358 | break; |
| 359 | case SymbolBody::DefinedCommonKind: |
| 360 | Out = BssSec; |
| 361 | break; |
| 362 | case SymbolBody::UndefinedKind: |
| 363 | case SymbolBody::DefinedAbsoluteKind: |
| 364 | case SymbolBody::SharedKind: |
| 365 | break; |
| 366 | case SymbolBody::LazyKind: |
| 367 | llvm_unreachable("Lazy symbol got to output symbol table!"); |
| 368 | } |
| 369 | |
| 370 | ESym->setBindingAndType(InputSym.getBinding(), InputSym.getType()); |
| 371 | ESym->st_size = InputSym.st_size; |
| 372 | ESym->setVisibility(Body->getMostConstrainingVisibility()); |
| 373 | if (InputSym.isAbsolute()) { |
| 374 | ESym->st_shndx = SHN_ABS; |
| 375 | ESym->st_value = InputSym.st_value; |
| 376 | } |
| 377 | |
| 378 | if (Section) |
| 379 | Out = Section->getOutputSection(); |
| 380 | |
| 381 | if (Out) { |
| 382 | ESym->st_shndx = Out->getSectionIndex(); |
| 383 | uintX_t VA = Out->getVA(); |
| 384 | if (Section) |
| 385 | VA += Section->getOutputSectionOff(); |
| 386 | if (auto *C = dyn_cast<DefinedCommon<ELFT>>(Body)) |
| 387 | VA += C->OffsetInBSS; |
| 388 | else |
| 389 | VA += InputSym.st_value; |
| 390 | ESym->st_value = VA; |
| 391 | } |
| 392 | |
| 393 | Buf += sizeof(Elf_Sym); |
| 394 | } |
| 395 | } |
| 396 | |
| 397 | namespace lld { |
| 398 | namespace elf2 { |
| 399 | template class OutputSectionBase<false>; |
| 400 | template class OutputSectionBase<true>; |
| 401 | |
| 402 | template void OutputSectionBase<false>::writeHeaderTo<support::little>( |
Rafael Espindola | f68b707 | 2015-09-21 22:21:46 +0000 | [diff] [blame] | 403 | ELFFile<ELFType<support::little, false>>::Elf_Shdr *SHdr); |
Rafael Espindola | 5805c4f | 2015-09-21 21:38:08 +0000 | [diff] [blame] | 404 | template void OutputSectionBase<true>::writeHeaderTo<support::little>( |
Rafael Espindola | f68b707 | 2015-09-21 22:21:46 +0000 | [diff] [blame] | 405 | ELFFile<ELFType<support::little, true>>::Elf_Shdr *SHdr); |
Rafael Espindola | 5805c4f | 2015-09-21 21:38:08 +0000 | [diff] [blame] | 406 | template void OutputSectionBase<false>::writeHeaderTo<support::big>( |
Rafael Espindola | f68b707 | 2015-09-21 22:21:46 +0000 | [diff] [blame] | 407 | ELFFile<ELFType<support::big, false>>::Elf_Shdr *SHdr); |
Rafael Espindola | 5805c4f | 2015-09-21 21:38:08 +0000 | [diff] [blame] | 408 | template void OutputSectionBase<true>::writeHeaderTo<support::big>( |
Rafael Espindola | f68b707 | 2015-09-21 22:21:46 +0000 | [diff] [blame] | 409 | ELFFile<ELFType<support::big, true>>::Elf_Shdr *SHdr); |
Rafael Espindola | 5805c4f | 2015-09-21 21:38:08 +0000 | [diff] [blame] | 410 | |
| 411 | template class GotSection<ELF32LE>; |
| 412 | template class GotSection<ELF32BE>; |
| 413 | template class GotSection<ELF64LE>; |
| 414 | template class GotSection<ELF64BE>; |
| 415 | |
| 416 | template class PltSection<ELF32LE>; |
| 417 | template class PltSection<ELF32BE>; |
| 418 | template class PltSection<ELF64LE>; |
| 419 | template class PltSection<ELF64BE>; |
| 420 | |
| 421 | template class RelocationSection<ELF32LE>; |
| 422 | template class RelocationSection<ELF32BE>; |
| 423 | template class RelocationSection<ELF64LE>; |
| 424 | template class RelocationSection<ELF64BE>; |
| 425 | |
| 426 | template class InterpSection<false>; |
| 427 | template class InterpSection<true>; |
| 428 | |
| 429 | template class HashTableSection<ELF32LE>; |
| 430 | template class HashTableSection<ELF32BE>; |
| 431 | template class HashTableSection<ELF64LE>; |
| 432 | template class HashTableSection<ELF64BE>; |
| 433 | |
| 434 | template class DynamicSection<ELF32LE>; |
| 435 | template class DynamicSection<ELF32BE>; |
| 436 | template class DynamicSection<ELF64LE>; |
| 437 | template class DynamicSection<ELF64BE>; |
| 438 | |
| 439 | template class OutputSection<ELF32LE>; |
| 440 | template class OutputSection<ELF32BE>; |
| 441 | template class OutputSection<ELF64LE>; |
| 442 | template class OutputSection<ELF64BE>; |
| 443 | |
| 444 | template class StringTableSection<false>; |
| 445 | template class StringTableSection<true>; |
| 446 | |
| 447 | template class SymbolTableSection<ELF32LE>; |
| 448 | template class SymbolTableSection<ELF32BE>; |
| 449 | template class SymbolTableSection<ELF64LE>; |
| 450 | template class SymbolTableSection<ELF64BE>; |
| 451 | |
Rafael Espindola | 56f965f | 2015-09-21 22:48:12 +0000 | [diff] [blame] | 452 | template ELFFile<ELF32LE>::uintX_t getSymVA(const DefinedRegular<ELF32LE> *DR); |
Rafael Espindola | 5805c4f | 2015-09-21 21:38:08 +0000 | [diff] [blame] | 453 | |
Rafael Espindola | 56f965f | 2015-09-21 22:48:12 +0000 | [diff] [blame] | 454 | template ELFFile<ELF32BE>::uintX_t getSymVA(const DefinedRegular<ELF32BE> *DR); |
Rafael Espindola | 5805c4f | 2015-09-21 21:38:08 +0000 | [diff] [blame] | 455 | |
Rafael Espindola | 56f965f | 2015-09-21 22:48:12 +0000 | [diff] [blame] | 456 | template ELFFile<ELF64LE>::uintX_t getSymVA(const DefinedRegular<ELF64LE> *DR); |
Rafael Espindola | 5805c4f | 2015-09-21 21:38:08 +0000 | [diff] [blame] | 457 | |
Rafael Espindola | 56f965f | 2015-09-21 22:48:12 +0000 | [diff] [blame] | 458 | template ELFFile<ELF64BE>::uintX_t getSymVA(const DefinedRegular<ELF64BE> *DR); |
Rafael Espindola | 4ea0021 | 2015-09-21 22:01:00 +0000 | [diff] [blame] | 459 | |
Rafael Espindola | 56f965f | 2015-09-21 22:48:12 +0000 | [diff] [blame] | 460 | template ELFFile<ELF32LE>::uintX_t |
Denis Protivensky | 67d0148 | 2015-09-22 08:14:46 +0000 | [diff] [blame] | 461 | getLocalSymVA(const ELFFile<ELF32LE>::Elf_Sym *Sym, |
| 462 | const ObjectFile<ELF32LE> &File); |
Rafael Espindola | 4ea0021 | 2015-09-21 22:01:00 +0000 | [diff] [blame] | 463 | |
Rafael Espindola | 56f965f | 2015-09-21 22:48:12 +0000 | [diff] [blame] | 464 | template ELFFile<ELF32BE>::uintX_t |
Denis Protivensky | 67d0148 | 2015-09-22 08:14:46 +0000 | [diff] [blame] | 465 | getLocalSymVA(const ELFFile<ELF32BE>::Elf_Sym *Sym, |
| 466 | const ObjectFile<ELF32BE> &File); |
Rafael Espindola | 4ea0021 | 2015-09-21 22:01:00 +0000 | [diff] [blame] | 467 | |
Rafael Espindola | 56f965f | 2015-09-21 22:48:12 +0000 | [diff] [blame] | 468 | template ELFFile<ELF64LE>::uintX_t |
Denis Protivensky | 67d0148 | 2015-09-22 08:14:46 +0000 | [diff] [blame] | 469 | getLocalSymVA(const ELFFile<ELF64LE>::Elf_Sym *Sym, |
| 470 | const ObjectFile<ELF64LE> &File); |
Rafael Espindola | 4ea0021 | 2015-09-21 22:01:00 +0000 | [diff] [blame] | 471 | |
Rafael Espindola | 56f965f | 2015-09-21 22:48:12 +0000 | [diff] [blame] | 472 | template ELFFile<ELF64BE>::uintX_t |
Denis Protivensky | 67d0148 | 2015-09-22 08:14:46 +0000 | [diff] [blame] | 473 | getLocalSymVA(const ELFFile<ELF64BE>::Elf_Sym *Sym, |
| 474 | const ObjectFile<ELF64BE> &File); |
Rafael Espindola | 5805c4f | 2015-09-21 21:38:08 +0000 | [diff] [blame] | 475 | } |
| 476 | } |